/* ============================================================
   布局增强：分类宫格 + 右侧功能 Dock
   ============================================================ */

/* ---------- 关掉卡片的光泽扫过（太花） ---------- */
.np-tilt::before,
.np-tilt::after {
  display: none !important;
}

/* ---------- 分类宫格 ---------- */
#np-cats {
  margin-bottom: 18px;
}

#np-cats .np-cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

#np-cats a.np-cat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  -webkit-backdrop-filter: blur(var(--np-card-blur, 14px));
  backdrop-filter: blur(var(--np-card-blur, 14px));
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

#np-cats a.np-cat:hover {
  transform: translateY(-3px);
  border-color: rgba(143, 183, 209, .5);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
}

#np-cats .np-cat-icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, #7fa6c0, #5b7c99);
}

#np-cats .np-cat-info {
  min-width: 0;
}

#np-cats .np-cat-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#np-cats .np-cat-count {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- 右侧功能 Dock ---------- */
#np-dock {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}

#np-dock button {
  position: relative;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  cursor: pointer;
  color: #dbe6ef;
  background: rgba(20, 25, 32, .55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
  transition: transform .22s ease, background .22s ease, color .22s ease;
  font-size: 14px;
}

#np-dock button:hover {
  background: rgba(91, 124, 153, .6);
  color: #fff;
}

/* 不用位移做 hover，否则指针在边缘会来回抖动，感觉"点不动" */

#np-dock button::after {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  white-space: nowrap;
  color: #e7ecf2;
  background: rgba(20, 25, 32, .9);
  border: 1px solid rgba(255, 255, 255, .1);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

#np-dock button:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* 隐藏主题原本的右侧栏，避免两套按钮 */
#rightside {
  display: none !important;
}

@media screen and (max-width: 768px) {
  #np-dock {
    right: 10px;
    gap: 6px;
  }
  #np-dock button {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }
  #np-cats .np-cats-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}
/* 点击反馈：按下去有轻微回弹，手感更"灵敏" */
#np-dock button:active {
  transform: scale(.92);
}

#np-dock button,
#np-top {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}