/* ============================================================
   全站视觉增强样式
   提升动画节奏、悬浮反馈、滚动体验
   ============================================================ */

/* ---------- Hero 区域入场动画 ---------- */
.hero-content > * {
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.25s; }
.hero-content > *:nth-child(3) { animation-delay: 0.4s; }
.hero-content > *:nth-child(4) { animation-delay: 0.55s; }
.hero-image {
    opacity: 0;
    transform: translateX(40px) scale(0.96);
    animation: heroImageIn 1s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}
@keyframes heroFadeUp {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes heroImageIn {
    to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ---------- 卡片悬浮效果增强 ---------- */
.feature-card, .product-card {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s;
    will-change: transform, box-shadow;
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(11, 29, 50, 0.12);
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(11, 29, 50, 0.14);
}
.product-card:hover .product-image img,
.product-card:hover > img {
    transform: scale(1.05);
}
.product-card .product-image img,
.product-card > img {
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 按钮悬浮效果增强 ---------- */
.cta-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.cta-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}
.cta-button:hover::after {
    left: 100%;
}
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(27, 111, 159, 0.35);
}
.cta-button:active {
    transform: translateY(0);
}

/* ---------- 滚动触发错落动画 ---------- */
.fade-in {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}
/* 网格内元素依次入场 */
.features-grid .fade-in.is-visible:nth-child(2),
.products-grid .fade-in.is-visible:nth-child(2) { transition-delay: 0.1s; }
.features-grid .fade-in.is-visible:nth-child(3),
.products-grid .fade-in.is-visible:nth-child(3) { transition-delay: 0.2s; }
.features-grid .fade-in.is-visible:nth-child(4),
.products-grid .fade-in.is-visible:nth-child(4) { transition-delay: 0.3s; }
.features-grid .fade-in.is-visible:nth-child(5),
.products-grid .fade-in.is-visible:nth-child(5) { transition-delay: 0.4s; }
.features-grid .fade-in.is-visible:nth-child(6),
.products-grid .fade-in.is-visible:nth-child(6) { transition-delay: 0.5s; }

/* ---------- 平滑滚动 ---------- */
html {
    scroll-behavior: smooth;
}

/* ---------- 导航栏滚动效果增强 ---------- */
.header {
    transition: background 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}
.header.scrolled {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(11, 29, 50, 0.08);
}

/* ---------- 右侧悬浮联系组件 ---------- */
.float-contact {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.float-contact-item {
    position: relative;
    width: 48px;
    height: 48px;
    background: #1b6f9f;
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: -2px 2px 12px rgba(11, 29, 50, 0.15);
}
.float-contact-item:hover {
    width: 56px;
    background: #0b1d32;
}
.float-contact-item .float-icon {
    font-size: 20px;
    color: #fff;
}
.float-contact-item .float-text {
    position: absolute;
    right: 56px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: #0b1d32;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.float-contact-item:hover .float-text {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* ---------- 图片加载优化 ---------- */
img {
    transition: opacity 0.4s;
}
img[loading="lazy"] {
    opacity: 0;
}
img[loading="lazy"].loaded {
    opacity: 1;
}

/* ---------- 尊重减少动画偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
    .hero-content > *, .hero-image, .fade-in {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    html { scroll-behavior: auto; }
}

/* ---------- 区域标题入场动画 ---------- */
.section-title {
    opacity: 0;
    transform: translateY(20px);
    animation: sectionTitleIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes sectionTitleIn {
    to { opacity: 1; transform: translateY(0); }
}


/* ---------- 页脚链接悬浮效果 ---------- */
.footer-links a {
    transition: color 0.25s, padding-left 0.25s;
}
.footer-links a:hover {
    color: #fff;
    padding-left: 6px;
}

/* ---------- 悬浮组件移动端适配 ---------- */
@media (max-width: 768px) {
    .float-contact {
        gap: 6px;
    }
    .float-contact-item {
        width: 42px;
        height: 42px;
    }
    .float-contact-item:hover {
        width: 42px;
    }
    .float-contact-item .float-icon {
        font-size: 17px;
    }
    .float-contact-item .float-text {
        display: none;
    }
}

/* ---------- 小屏幕 hero 优化 ---------- */
@media (max-width: 768px) {
    .hero-content > * {
        animation-duration: 0.6s;
    }
    .hero-image {
        animation-delay: 0.2s;
    }
}

/* ---------- 下部区域色彩层次优化 ---------- */
/* 应用领域区块：深蓝背景，与 hero 呼应 */
.section:has(.features-grid):has(.feature-icon) {
    position: relative;
}

/* 深色区块通用样式 */
.section-dark {
    background: linear-gradient(135deg, #0b1d32 0%, #123451 60%, #1b4e70 100%) !important;
    color: #fff;
}
.section-dark .section-title {
    color: #fff;
}
.section-dark .section-subtitle {
    color: rgba(255, 255, 255, 0.65);
}
.section-dark .feature-card {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}
.section-dark .feature-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}
.section-dark .feature-title {
    color: #fff;
}
.section-dark .feature-description {
    color: rgba(255, 255, 255, 0.7);
}

/* 特性卡片顶部品牌色边框点缀 */
.feature-card {
    position: relative;
}
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1b6f9f, #d88732);
    opacity: 0;
    transition: opacity 0.3s;
}
.feature-card:hover::before {
    opacity: 1;
}

/* 时间线品牌色点缀增强 */
.timeline-item {
    position: relative;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #1b6f9f, #d88732);
    border-radius: 2px;
    opacity: 0.6;
}

/* CTA 区块渐变层次增强 */
.section[style*="linear-gradient(135deg, #0066CC"] {
    position: relative;
    overflow: hidden;
}
.section[style*="linear-gradient(135deg, #0066CC"]::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}
.section[style*="linear-gradient(135deg, #0066CC"]::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(216,135,50,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

/* 产品卡片图片保险样式 - 确保始终可见 */
.product-card.fade-in.is-visible,
.product-card .product-image {
    opacity: 1 !important;
    transform: none !important;
}

/* 产品卡片紧凑化调整 */
.products-grid {
    gap: 20px;
}
.product-card .product-image {
    height: 180px !important;
    padding: 12px;
}
.product-card .product-info {
    padding: 14px 16px;
}
.product-card .product-title {
    font-size: 16px;
    margin-bottom: 6px;
}
.product-card .product-description {
    font-size: 13px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- 内容可见性强保底：防止滚动入场动画未触发导致图片/卡片不可见 ---------- */
.feature-card.fade-in,
.product-card.fade-in,
.case-card.fade-in {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  animation: none !important;
}
.feature-card * ,
.product-card * ,
.case-card * {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  animation: none !important;
}

/* ---------- 导航菜单项精确垂直居中对齐 ---------- */
.nav-menu > li {
    display: flex;
    align-items: center;
}
.nav-menu > li > a {
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

/* ---------- 导航末项像素级水平归位：消除行框基线导致的 3px 下移 ---------- */
.nav-menu > li:last-child > a {
    margin-top: -3px;
}

/* nav last alignment fix */

/* 联系我们菜单水平归位修正 */
.nav-menu>li:last-child>a{
  position: relative;
  top: -1.5px;
}
