/* 侧栏组件增强（配合 source/assets/static/js/sidebar-widgets.js）
 * A. 标签云「3D 爆炸球」：覆盖主题默认的卡片背景与内边距
 * B. nodeseek iframe 等比缩放：外层容器 + transform: scale()
 * 选择器特异性均高于主题默认规则，无需 !important。
 */

.widget-wrapper.tagcloud .widget-body.tagcloud-sphere {
  position: relative;
  /* 侧栏窄而高：给足纵向空间，标签才铺得开（椭球半径按此高度计算） */
  height: 340px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  overflow: hidden;
  /* 允许纵向滚动穿透，避免在移动端挡住页面滚动 */
  touch-action: pan-y;
  cursor: grab;
}

.widget-wrapper.tagcloud .widget-body.tagcloud-sphere > a.tag {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.2;
  text-decoration: none;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
  color: var(--text-p2);
  background: transparent;
  transition: color 0.18s ease, background-color 0.18s ease;
  /* 防止文字被选中，拖拽体验更好 */
  user-select: none;
  -webkit-user-select: none;
}

.widget-wrapper.tagcloud .widget-body.tagcloud-sphere > a.tag:hover,
.widget-wrapper.tagcloud .widget-body.tagcloud-sphere > a.tag:focus-visible {
  color: var(--accent);
  background: var(--bg-a50);
  outline: none;
  filter: none !important;
}

/* 右下角操作提示 */
.tagcloud-sphere .tagcloud-hint {
  position: absolute;
  right: 2px;
  bottom: 0;
  font-size: 11px;
  line-height: 1;
  opacity: 0.42;
  pointer-events: none;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  .widget-wrapper.tagcloud .widget-body.tagcloud-sphere > a.tag {
    transition: none;
  }
}

/* ------------------------------------------------------------------
 * nodeseek 推广 iframe：等比缩放
 * ------------------------------------------------------------------
 * 侧栏宽度通常只有 200~260px，内嵌页卡片本身是 310px 宽（max-width 封顶）。
 * 直接用 width:100% 会让内容被横向压扁（文字变形、按钮挤成一团）。
 *
 * 做法：iframe 按 310×246 的虚拟视口渲染（实测值），再由脚本整体
 * transform: scale() 等比缩小。因为在固定视口下渲染，内嵌页不会重排，
 * 缩放后比例完全不变，视觉上是「完整缩略图」而不是「被压扁的页面」。
 *
 * 容器宽高都由脚本按 scale 写入，这里只给首帧兜底值。
 */
.nodeseek-frame {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  height: 120px;
  background: var(--bg-a50);
}

.nodeseek-frame > iframe {
  position: absolute;
  left: 0;
  top: 0;
  width: 310px;
  height: 246px;
  border: 0;
  border-radius: 8px;
  transform-origin: 0 0;
  /* 脚本会写入具体 scale，这里只给铺底值 */
  transform: scale(0.5);
}
