/**
 * 资讯 / 政策页 CTA — 参考一线 AI 品牌站（如超参数 chaocanshu 类）的克制动效：
 * 主按钮扫光、幽灵次按钮、列表左侧能量条、返回微位移动效。
 */

.xm-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 9999px;
  cursor: pointer;
  isolation: isolate;
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.32s ease,
    border-color 0.25s ease,
    color 0.25s ease;
}

.xm-cta:focus-visible {
  outline: 2px solid rgba(232, 121, 249, 0.75);
  outline-offset: 3px;
}

.xm-cta--primary {
  color: #f0fdff;
  border: 1px solid rgba(34, 211, 238, 0.45);
  background: linear-gradient(
    135deg,
    rgba(14, 116, 144, 0.42) 0%,
    rgba(88, 28, 135, 0.48) 48%,
    rgba(8, 47, 73, 0.78) 100%
  );
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 4px 20px rgba(34, 211, 238, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.xm-cta--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    105deg,
    transparent 38%,
    rgba(255, 255, 255, 0.16) 50%,
    transparent 62%
  );
  transform: translateX(-130%);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
}

.xm-cta--primary:hover::after {
  transform: translateX(130%);
}

.xm-cta--primary:hover {
  transform: translateY(-2px);
  border-color: rgba(232, 121, 249, 0.55);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.25),
    0 8px 28px rgba(34, 211, 238, 0.28),
    0 0 40px rgba(232, 121, 249, 0.14);
}

.xm-cta--primary > span,
.xm-cta--ghost > span {
  position: relative;
  z-index: 1;
}

.xm-cta__chev {
  position: relative;
  z-index: 1;
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-block;
}

.xm-cta--primary:hover .xm-cta__chev {
  transform: translate(3px, -3px);
}

.xm-cta--ghost {
  color: rgba(186, 230, 253, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(6, 8, 20, 0.4);
  backdrop-filter: blur(8px);
}

.xm-cta--ghost:hover {
  color: #f0fdfa;
  border-color: rgba(34, 211, 238, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.14);
}

/* 顶栏式返回：轻量、可横向「退」一步的微动效 */
.xm-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem 0.5rem 1rem;
  font-size: clamp(0.8rem, 2.5vw, 0.9rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(207, 250, 254, 0.95);
  text-decoration: none;
  border-radius: 9999px;
  border: 1px solid rgba(34, 211, 238, 0.38);
  background: rgba(4, 10, 22, 0.72);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.12);
  white-space: nowrap;
  max-width: min(100%, 100vw - 2rem);
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease,
    border-color 0.25s ease;
}

.xm-back:focus-visible {
  outline: 2px solid rgba(232, 121, 249, 0.75);
  outline-offset: 3px;
}

.xm-back:hover {
  transform: translateX(4px);
  border-color: rgba(232, 121, 249, 0.48);
  box-shadow:
    0 0 22px rgba(232, 121, 249, 0.16),
    0 0 26px rgba(34, 211, 238, 0.12);
}

@media (max-width: 380px) {
  .xm-back {
    white-space: normal;
    text-align: center;
    max-width: 11rem;
  }
}

/* 资讯流：悬停时左侧能量条（不占额外 DOM） */
.ai-news-stream > .news-item {
  position: relative;
  padding-left: calc(0.75rem + 8px);
}

.ai-news-stream > .news-item::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 1.1rem;
  bottom: 1.1rem;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #22d3ee, #e879f9);
  opacity: 0;
  transform: scaleY(0.35);
  transform-origin: center top;
  transition:
    opacity 0.25s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-news-stream > .news-item:hover::before,
.ai-news-stream > .news-item:focus-within::before {
  opacity: 1;
  transform: scaleY(1);
}

@media (prefers-reduced-motion: reduce) {
  .xm-cta--primary::after {
    transition: none;
  }
  .xm-cta--primary:hover::after {
    transform: none;
  }
  .xm-cta,
  .xm-back,
  .xm-cta__chev {
    transition: none;
  }
  .xm-cta--primary:hover,
  .xm-cta--ghost:hover,
  .xm-back:hover {
    transform: none;
  }
  .xm-cta--primary:hover .xm-cta__chev {
    transform: none;
  }
  .ai-news-stream > .news-item::before {
    transition: none;
  }
}
