/* ==========================================================================
   nanhu web theme · anim.css  动效增强层
   浅色风格 · 克制 · 只叠加动画不改布局 · 尊重 prefers-reduced-motion
   加载在 base / nav / home / page 之后
   ========================================================================== */

/* ---------- 关键帧 ---------- */
@keyframes fx-fade-up    { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fx-fade-in    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fx-float      { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes fx-pulse-soft { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes fx-shine      { from { transform: translateX(-130%) skewX(-18deg); } to { transform: translateX(260%) skewX(-18deg); } }

/* ---------- 首屏入场 ---------- */
.page-crumbs    { animation: fx-fade-up .5s cubic-bezier(.22, .61, .36, 1) both; }
.page-hero h1   { animation: fx-fade-up .6s cubic-bezier(.22, .61, .36, 1) .06s both; }
.page-hero-sub  { animation: fx-fade-up .6s cubic-bezier(.22, .61, .36, 1) .14s both; }

.cloud-home-page .enterprise-hero .hero-copy h1      { animation: fx-fade-up .7s cubic-bezier(.22, .61, .36, 1) both; }
.cloud-home-page .enterprise-hero .hero-copy > p     { animation: fx-fade-up .7s cubic-bezier(.22, .61, .36, 1) .1s both; }
.cloud-home-page .enterprise-hero .hero-actions      { animation: fx-fade-up .7s cubic-bezier(.22, .61, .36, 1) .18s both; }

/* 首页背景光斑缓慢漂浮 */
.hero-glow-blob-1 { animation: fx-float 9s ease-in-out infinite; }
.hero-glow-blob-2 { animation: fx-float 11s ease-in-out infinite reverse; }

/* ---------- 卡片入场（错峰） ---------- */
.news-item, .side-card, .article-card, .cate-chip, .page-empty {
  animation: fx-fade-up .5s cubic-bezier(.22, .61, .36, 1) both;
}
.news-list .news-item:nth-child(1) { animation-delay: .02s; }
.news-list .news-item:nth-child(2) { animation-delay: .08s; }
.news-list .news-item:nth-child(3) { animation-delay: .14s; }
.news-list .news-item:nth-child(4) { animation-delay: .20s; }
.news-list .news-item:nth-child(5) { animation-delay: .26s; }
.news-list .news-item:nth-child(6) { animation-delay: .32s; }

/* ---------- 悬浮：卡片抬升 ---------- */
.side-card, .article-card {
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.side-card:hover   { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(25, 46, 53, .10); border-color: #f3ddc7; }
.article-card:hover { box-shadow: 0 18px 40px rgba(25, 46, 53, .10); }

/* 侧栏链接：hover 右移并显现指示条 */
.side-list a { position: relative; transition: color .2s ease, padding-left .2s ease; }
.side-list a:hover { padding-left: 6px; }
.side-list a::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 0;
  background: var(--Original); border-radius: 2px; transform: translateY(-50%);
  transition: height .2s ease;
}
.side-list a:hover::before { height: 14px; }

/* 分类胶囊 */
.cate-chip { transition: border-color .2s, color .2s, background .2s, transform .2s; }
.cate-chip:hover { transform: translateY(-2px); }

/* 图片轻微放大 */
.news-item img, .article-body img { transition: transform .35s ease; }
.news-item:hover img   { transform: scale(1.04); }
.article-body img:hover { transform: scale(1.01); }

/* ---------- 按钮：光泽扫过 + 抬升 ---------- */
.cloud-home-page .hero-actions .primary-link { position: relative; overflow: hidden; }
.cloud-home-page .hero-actions .primary-link::after {
  content: ""; position: absolute; top: 0; left: 0; width: 42%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: translateX(-140%) skewX(-18deg); pointer-events: none;
}
.cloud-home-page .hero-actions .primary-link:hover::after { animation: fx-shine .75s ease; }

.side-search button, .page-pagination li a { transition: background .2s, border-color .2s, color .2s, transform .2s; }
.side-search button:hover   { transform: translateY(-1px); }
.page-pagination li a:hover { transform: translateY(-2px); }

/* 空状态图标脉冲 */
.page-empty i { display: inline-block; animation: fx-pulse-soft 2.4s ease-in-out infinite; }

/* 侧栏计数徽标 */
.side-list .count { transition: background .2s, color .2s; }
.side-list a:hover .count { background: #ffeee0; color: var(--Original); }

/* ---------- 导航大菜单：面板内容错峰入场（面板再次展开会重播） ---------- */
.menu-dropdown-panel.active .Submenu-product-name,
.menu-dropdown-panel.active .list-product-content {
  animation: fx-fade-up .32s cubic-bezier(.22, .61, .36, 1) both;
}
.menu-dropdown-panel.active .Submenu-product-name:nth-child(1) { animation-delay: .03s; }
.menu-dropdown-panel.active .Submenu-product-name:nth-child(2) { animation-delay: .07s; }
.menu-dropdown-panel.active .Submenu-product-name:nth-child(3) { animation-delay: .11s; }
.menu-dropdown-panel.active .Submenu-product-name:nth-child(4) { animation-delay: .15s; }
.menu-dropdown-panel.active .Submenu-product-name:nth-child(5) { animation-delay: .19s; }
.menu-dropdown-panel.active .Submenu-product-name:nth-child(6) { animation-delay: .23s; }
.menu-dropdown-panel.active .list-product-content:nth-child(1) { animation-delay: .05s; }
.menu-dropdown-panel.active .list-product-content:nth-child(2) { animation-delay: .09s; }
.menu-dropdown-panel.active .list-product-content:nth-child(3) { animation-delay: .13s; }
.menu-dropdown-panel.active .list-product-content:nth-child(4) { animation-delay: .17s; }
.menu-dropdown-panel.active .list-product-content:nth-child(5) { animation-delay: .21s; }
.menu-dropdown-panel.active .list-product-content:nth-child(6) { animation-delay: .25s; }
.menu-dropdown-panel.active .list-product-content:nth-child(7) { animation-delay: .29s; }
.menu-dropdown-panel.active .list-product-content:nth-child(8) { animation-delay: .33s; }

/* ---------- 首屏指标卡 / HUD 芯片：错峰入场 ---------- */
.hero-metric-deck .metric-card { animation: fx-fade-up .6s cubic-bezier(.22, .61, .36, 1) both; }
.hero-metric-deck .metric-card:nth-child(1) { animation-delay: .05s; }
.hero-metric-deck .metric-card:nth-child(2) { animation-delay: .11s; }
.hero-metric-deck .metric-card:nth-child(3) { animation-delay: .17s; }
.hero-metric-deck .metric-card:nth-child(4) { animation-delay: .23s; }
.hero-metric-deck .metric-card:nth-child(5) { animation-delay: .29s; }
.hero-metric-deck .metric-card:nth-child(6) { animation-delay: .35s; }
.hero-hud-cluster-top-right,
.hero-hud-cluster-bottom-right,
.hero-hud-cluster-bottom-left { animation: fx-fade-in .9s ease both; }
.hero-hud-cluster-top-right { animation-delay: .35s; }
.hero-hud-cluster-bottom-right { animation-delay: .5s; }
.hero-hud-cluster-bottom-left { animation-delay: .65s; }
.hero-hud-chip { transition: transform .25s ease, box-shadow .25s ease; }
.hero-hud-chip:hover { transform: translateY(-3px); }

/* 运行状态圆点：呼吸光环 */
@keyframes fx-ring { 0% { box-shadow: 0 0 0 0 rgba(120, 140, 150, .45); } 100% { box-shadow: 0 0 0 8px rgba(120, 140, 150, 0); } }
.metric-status-dot, .status-pulse-dot { animation: fx-ring 1.8s ease-out infinite; }

/* ---------- 通用卡片：悬浮抬升 ---------- */
.cloud-product-card, .qq-group-card, .ai-model-card, .cloud-service { transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.cloud-product-card:hover, .qq-group-card:hover, .ai-model-card:hover, .cloud-service:hover { transform: translateY(-6px); box-shadow: 0 22px 46px rgba(25, 46, 53, .12); }
.qq-group-card:hover .qq-card-num, .ai-model-card:hover .item-name { letter-spacing: .2px; }

/* ---------- 网格卡片：进入视口后错峰上浮（配合 .reveal 滚动进场） ---------- */
:is(.cloud-product-grid, .ai-model-grid, .cloud-service-grid).reveal.is-visible > *,
:is(.qq-community, .enterprise-workflow, .cloud-products).reveal.is-visible :is(.qq-community-grid, .workflow-grid, .cloud-product-grid) > * {
  animation: fx-fade-up .55s cubic-bezier(.22, .61, .36, 1) both;
}
:is(.cloud-product-grid, .ai-model-grid, .cloud-service-grid).reveal.is-visible > *:nth-child(2),
:is(.qq-community, .enterprise-workflow, .cloud-products).reveal.is-visible :is(.qq-community-grid, .workflow-grid, .cloud-product-grid) > *:nth-child(2) { animation-delay: .08s; }
:is(.cloud-product-grid, .ai-model-grid, .cloud-service-grid).reveal.is-visible > *:nth-child(3),
:is(.qq-community, .enterprise-workflow, .cloud-products).reveal.is-visible :is(.qq-community-grid, .workflow-grid, .cloud-product-grid) > *:nth-child(3) { animation-delay: .16s; }
:is(.cloud-product-grid, .ai-model-grid, .cloud-service-grid).reveal.is-visible > *:nth-child(4),
:is(.qq-community, .enterprise-workflow, .cloud-products).reveal.is-visible :is(.qq-community-grid, .workflow-grid, .cloud-product-grid) > *:nth-child(4) { animation-delay: .24s; }
:is(.cloud-product-grid, .ai-model-grid, .cloud-service-grid).reveal.is-visible > *:nth-child(5),
:is(.qq-community, .enterprise-workflow, .cloud-products).reveal.is-visible :is(.qq-community-grid, .workflow-grid, .cloud-product-grid) > *:nth-child(5) { animation-delay: .32s; }
:is(.cloud-product-grid, .ai-model-grid, .cloud-service-grid).reveal.is-visible > *:nth-child(6),
:is(.qq-community, .enterprise-workflow, .cloud-products).reveal.is-visible :is(.qq-community-grid, .workflow-grid, .cloud-product-grid) > *:nth-child(6) { animation-delay: .40s; }

/* ---------- CTA / 卡片按钮：光泽扫过 ---------- */
.card-btn, .cta-actions a { position: relative; overflow: hidden; }
.card-btn::after, .cta-actions a::after {
  content: ""; position: absolute; top: 0; left: 0; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: translateX(-140%) skewX(-18deg); pointer-events: none;
}
.card-btn:hover::after, .cta-actions a:hover::after { animation: fx-shine .8s ease; }

/* ---------- 页脚：链接微移 ---------- */
.cloud-footer-col a { transition: color .2s ease, transform .2s ease; }
.cloud-footer-col a:hover { transform: translateX(3px); }

/* ---------- 无障碍：减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
