/* 基础样式 */
.shaking-text {
  position: relative;
  display: block;
}

.tag-container {
  position: absolute;
  left: auto;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: row-reverse;
  gap: 12px;
  align-items: center;
  white-space: nowrap;
  z-index: 99;

  /* 强制隔离书写方向影响 */
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  direction: ltr !important;
  unicode-bidi: plaintext !important;
}

.page-tag {
  position: relative;
  display: inline-block;
  padding: 10px 12px;
  border-radius: 999px;
  background: #ff8c006d;
  color: #222;
  font-size: 1.5rem;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  cursor: pointer;
  flex-shrink: 0; /* 防止标签被压缩 */
}

.page-tag:hover,
.page-tag:focus {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  text-decoration: none;
}

.page-tag:active {
  transform: translateY(-1px) scale(0.996);
}

.page-tag:focus {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14), 0 0 0 3px rgba(0, 0, 0, 0.04);
}

/* 手动启用桌面端换行模式，在body写force-wrap-tags */
body.force-wrap-tags .tag-container {
  position: static !important;
  transform: none !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
  margin-top: 15px !important;
  white-space: normal !important;
  width: 100% !important;
  right: auto !important;
}

/* 响应式设计 */
@media (max-width: 1020px) {
  /* 移动端布局 - 标签单独成行 */
  .tag-container {
    position: static;
    transform: none;
    flex-direction: row-reverse; /* 保持与PC端相同的排列顺序 */
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 15px;
    white-space: normal;
    width: 100%;
    right: auto; /* 移除右侧定位 */
  }

  .page-tag {
    margin-bottom: 8px;
    font-size: 1.1rem;
  }
}

@media (max-width: 650px) {
  .page-tag {
    padding: 8px 10px;
  }

  .tag-container {
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .page-tag {
    font-size: 0.85rem;
    padding: 6px 8px;
  }

  .tag-container {
    gap: 6px;
  }
}

@media (max-width: 400px) {
  .tag-container {
    display: flex !important;
  }
}
