/* ===== 首页视觉增强 ===== */

/* --- 滚动触发动画 --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(59,130,246,0.3); }
  50% { box-shadow: 0 0 20px rgba(59,130,246,0.5); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* 滚动触发类（初始隐藏） */
.reveal {
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.active {
  opacity: 1;
}
.reveal.fade-up.active { animation: fadeInUp 0.8s ease forwards; }
.reveal.fade-left.active { animation: fadeInLeft 0.8s ease forwards; }
.reveal.fade-right.active { animation: fadeInRight 0.8s ease forwards; }
.reveal.scale-in.active { animation: scaleIn 0.7s ease forwards; }

/* --- Hero 增强 --- */
.hero-gradient {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
  position: relative;
  overflow: hidden;
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 浮动粒子 */
.particle-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(147, 197, 253, 0.2);
  border-radius: 50%;
  animation: particleFloat linear infinite;
}
@keyframes particleFloat {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

/* Hero 标题渐变色文字 */
.hero-title-gradient {
  background: linear-gradient(135deg, #f0f9ff 0%, #93c5fd 50%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- 统计数字动画 --- */
.stat-number {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}
.stat-item {
  transition: transform 0.3s ease;
}
.stat-item:hover {
  transform: translateY(-4px);
}

/* --- 服务卡片增强 --- */
.service-card {
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}
.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(59,130,246,0.08) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.service-card:hover::before {
  opacity: 1;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -12px rgba(59,130,246,0.25);
  border-color: rgba(59,130,246,0.2);
}
.service-card .card-icon {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.service-card:hover .card-icon {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 8px 24px rgba(59,130,246,0.3);
}
.service-card .card-badge {
  transition: all 0.3s ease;
}
.service-card:hover .card-badge {
  background: rgba(59,130,246,0.3);
}
.service-card .card-arrow {
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}
.service-card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* 卡片错开动画延迟 */
.service-card:nth-child(1) { transition-delay: 0.05s; }
.service-card:nth-child(2) { transition-delay: 0.1s; }
.service-card:nth-child(3) { transition-delay: 0.15s; }
.service-card:nth-child(4) { transition-delay: 0.2s; }
.service-card:nth-child(5) { transition-delay: 0.25s; }
.service-card:nth-child(6) { transition-delay: 0.3s; }

/* --- 分类标题装饰 --- */
.section-title {
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 2px;
}

/* --- 导航栏滚动效果 --- */
.navbar-scrolled {
  background: rgba(15, 23, 42, 0.92) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

/* 导航链接下划线动画 */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 1px;
  transition: transform 0.3s ease;
}
.nav-link:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* --- 返回顶部按钮 --- */
.scroll-top-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(59,130,246,0.4);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
}
.scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
}
.scroll-top-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(59,130,246,0.5);
}

/* --- 过滤标签按钮 --- */
.filter-tag {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.filter-tag:hover, .filter-tag.active {
  background: rgba(59,130,246,0.2);
  border-color: rgba(59,130,246,0.4);
  color: #93c5fd;
}

/* --- 渐变分隔线 --- */
.gradient-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59,130,246,0.3), rgba(139,92,246,0.3), transparent);
  margin: 0 auto;
  max-width: 80%;
}

/* --- 数字徽章跳动 --- */
@keyframes badgePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.service-card .card-badge {
  transition: all 0.3s ease;
}
.service-card:hover .card-badge {
  animation: badgePulse 0.6s ease;
}

/* --- 搜索结果高亮 --- */
.search-highlight {
  background: linear-gradient(135deg, rgba(59,130,246,0.3), rgba(139,92,246,0.3));
  border-radius: 4px;
  padding: 0 4px;
}

/* --- 移动端适配 --- */
@media (max-width: 768px) {
  .scroll-top-btn {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* ===== 新增视觉增强 ===== */

/* --- 1. 滚动进度条 --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 12px rgba(59,130,246,0.5);
}

/* --- 2. 打字机效果 --- */
.typewriter-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.8em;
}
.typewriter-text {
  display: inline;
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid #93c5fd;
  animation: none;
}
.typewriter-text.typing {
  animation: blinkCaret 0.75s step-end infinite;
}
@keyframes blinkCaret {
  50% { border-color: transparent; }
}
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: #93c5fd;
  margin-left: 2px;
  animation: blinkCursor 0.75s step-end infinite;
  vertical-align: text-bottom;
}
@keyframes blinkCursor {
  50% { opacity: 0; }
}

/* --- 3. 3D 卡片倾斜（纯CSS变量方案，不注入DOM） --- */
.tilt-card {
  transition: transform 0.15s ease-out, box-shadow 0.3s ease;
  transform: perspective(800px)
    rotateX(calc(var(--ry,0) * 4deg))
    rotateY(calc(var(--rx,0) * 4deg))
    scale3d(1,1,1);
  will-change: transform;
}
.tilt-card[data-tilt=""] {
  transform: perspective(800px) rotateX(0deg) rotateY(0deg) scale3d(1,1,1);
}
.tilt-card:hover {
  box-shadow: 0 20px 40px -12px rgba(59,130,246,0.25);
  border-color: rgba(59,130,246,0.2);
}

/* --- 4. 鼠标跟随光晕 --- */
.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.08), transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 1;
  transition: opacity 0.5s ease;
  will-change: left, top;
}
.cursor-glow.hidden {
  opacity: 0;
}

/* --- 5. 统计数字滚动动画增强 --- */
@keyframes countUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.stat-number-animated {
  animation: countUp 0.6s ease forwards;
}

/* --- 6. 主体标题增强——解决"政企方案几个字看不清" --- */
.section-title {
  font-weight: 800 !important;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.section-title::after {
  width: 80px !important;
  height: 4px !important;
  bottom: -10px !important;
  background: linear-gradient(90deg, #2563eb, #7c3aed) !important;
  box-shadow: 0 1px 4px rgba(37,99,235,0.3);
}
