/****************************************************************
 *																*		
 * 						      响应式样式							*
 *                        海智先锋网站							*
 *       		  移动端适配和动态效果增强			*
 * 																*
****************************************************************/

/* ===== 响应式断点定义 ===== */
/* 大屏幕设备 (1200px及以上) */
@media (min-width: 1200px) {
    .iwidth {
        width: 1200px;
    }
}

/* 中等屏幕设备 (992px - 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
    .iwidth {
        width: 960px;
    }
    
    /* 调整服务项目布局 */
    .servicelist {
        padding: 20px 0;
        min-height: 500px;
    }
    
    .servicelist li {
        width: 220px;
        margin: 0 8px 20px;
        padding: 15px 10px;
    }
    
    /* 调整案例项目布局 */
    .icaselist li {
        width: 300px;
        margin: 0 8px;
    }
    
    /* 调整新闻布局 */
    .inews dd {
        width: 700px;
        min-height: 320px;
    }
    
    .btit {
        width: calc(100% - 90px);
    }
    
    .ilistnews li {
        width: 50%;
        margin-bottom: 30px;
        padding-right: 20px;
        box-sizing: border-box;
        min-height: 120px;
        display: flex;
        align-items: flex-start;
    }
}

/* 平板设备 (768px - 991px) */
@media (max-width: 991px) and (min-width: 768px) {
    .iwidth {
        width: 750px;
    }
    
    /* 导航菜单调整 */
    .nav-site {
        display: none;
    }
    
    .mobile-nav-toggle {
        display: block;
    }
    
    /* 服务项目改为2列布局 */
    .servicelist {
        padding: 20px 0;
        min-height: 550px;
    }
    
    .servicelist li {
        width: 48%;
        margin: 0 1% 25px;
        float: left;
        padding: 15px 10px;
    }
    
    /* 案例项目改为2列布局 */
    .icaselist li {
        width: 48%;
        margin: 0 1% 20px;
        float: left;
    }
    
    /* 新闻布局调整 */
    .inews dt {
        float: none;
        width: 100%;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .inews dd {
        float: none;
        width: 100%;
        height: auto;
    }
    
    .ilistnews li {
        width: 100%;
        margin-bottom: 20px;
        height: auto;
        min-height: auto;
        padding-right: 0;
        display: block;
    }
    
    .btit {
        width: 100%;
        float: none;
    }
}

/* 手机设备 (767px及以下) */
@media (max-width: 767px) {
    .iwidth {
        width: 100%;
        padding: 0 15px;
    }
    
    /* 隐藏桌面导航，显示移动导航按钮 */
    .nav-site {
        display: none;
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background: #0A2463;
        z-index: 999;
        padding: 20px 0;
    }
    
    .nav-site.mobile-active {
        display: block;
    }
    
    .nav-site li {
        float: none;
        width: 100%;
        height: auto;
        line-height: 50px;
        border-bottom: 1px solid #1F4860;
    }
    
    /* 移动端导航按钮样式 */
    .mobile-nav-toggle {
        display: block;
        position: fixed;
        top: 20px;
        right: 20px;
        width: 30px;
        height: 25px;
        z-index: 1001;
        cursor: pointer;
    }
    
    .mobile-nav-toggle span {
        display: block;
        width: 100%;
        height: 3px;
        background: #fff;
        margin: 5px 0;
        transition: all 0.3s ease;
    }
    
    .mobile-nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* 轮播图高度调整 */
    .banner {
        height: 300px;
        margin-top: 60px;
    }
    
    .banner ul li {
        height: 300px;
    }
    
    /* 服务项目改为单列布局 */
.servicelist {
    margin: 20px 0 0;
    padding: 20px 0;
    min-height: 600px;
}

.servicelist li {
    width: 100%;
    margin: 0 0 40px;
    float: none;
}
    
    /* 案例项目改为单列布局 */
    .icaselist {
        margin: 20px 0 0;
    }
    
    .icaselist li {
        width: 100%;
        margin: 0 0 20px;
        float: none;
    }
    
    .icaselist li .casethumb {
        height: 200px;
    }
    
    .icaselist li .casethumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* 新闻布局调整 */
    .inews dt {
        float: none;
        width: 100%;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .inews dt img {
        max-width: 100%;
        height: auto;
    }
    
    .inews dd {
        float: none;
        width: 100%;
        height: auto;
    }
    
    .ilistnews li {
        width: 100%;
        margin-bottom: 20px;
        float: none;
        height: auto;
        min-height: auto;
        padding-right: 0;
        display: block;
    }
    
    .ilistnews li span {
        float: none;
        margin: 0 auto 10px;
        display: block;
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }
    
    .btit {
        width: 100%;
        float: none;
        text-align: center;
        height: auto;
        min-height: auto;
    }
    
    /* 页脚调整 */
    .footer1 .fr,
    .footer1 .fl {
        float: none;
        text-align: center;
        margin: 10px 0;
    }
    
    /* 友情链接调整 */
    .links {
        height: auto;
        padding: 20px 0;
    }
    
    .links a {
        display: inline-block;
        margin: 5px 3px;
    }
}

/* ===== 动态效果和动画 ===== */

/* 页面加载动画 */
.header {
    transform: translateY(-100%);
    transition: transform 0.8s ease;
}

.header.header-loaded {
    transform: translateY(0);
}

.banner {
    opacity: 0;
    transform: scale(0.95);
    transition: all 1s ease;
}

.banner.banner-loaded {
    opacity: 1;
    transform: scale(1);
}

/* 滚动进入动画 */
.service-item,
.case-item,
.news-item {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.service-item.animate-in,
.case-item.animate-in,
.news-item.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* 服务项目悬停效果增强 */
.service-item {
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    margin-bottom: 20px;
    padding: 20px 10px;
}

.service-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 194, 209, 0.2);
    z-index: 10;
}

.service-item.hover-effect {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 194, 209, 0.3);
    z-index: 10;
}

.service-item .serico {
    transition: all 0.3s ease;
}

.service-item:hover .serico {
    transform: scale(1.1) rotate(5deg);
}

/* 案例项目点击效果 */
.case-item {
    transition: all 0.3s ease;
    cursor: pointer;
}

.case-item.click-effect {
    transform: scale(0.95);
    box-shadow: 0 10px 20px rgba(0, 194, 209, 0.4);
}

.case-item .casethumb {
    transition: all 0.3s ease;
}

.case-item:hover .casethumb {
    transform: scale(1.05);
}

/* 新闻项目悬停效果 */
.news-item {
    transition: all 0.3s ease;
    padding: 15px;
    border-radius: 8px;
}

.news-item.news-hover {
    background: rgba(0, 194, 209, 0.1);
    transform: translateX(10px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.news-item .idate {
    transition: all 0.3s ease;
}

.news-item:hover .idate {
    background: #00C2D1;
    color: #fff;
}

.news-item:hover .idate i,
.news-item:hover .idate em {
    color: #fff;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #00C2D1;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 194, 209, 0.3);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #FF6B35;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(255, 107, 53, 0.4);
}

.arrow-up {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 12px solid #fff;
    margin-top: 15px;
}

/* 导航菜单动画 */
.nav-site li {
    transition: all 0.3s ease;
}

.nav-site li:hover {
    background: rgba(0, 194, 209, 0.1);
}

.nav-site li a {
    transition: all 0.3s ease;
}

.nav-site li a:hover {
    transform: translateY(-2px);
}

/* 标题动画效果 */
.itit h2 {
    position: relative;
    overflow: hidden;
}

.itit h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: #00C2D1;
    transition: left 0.8s ease;
}

.service-item.animate-in .itit h2::after,
.case-item.animate-in .itit h2::after,
.news-item.animate-in .itit h2::after {
    left: 0;
}

/* 图片悬停效果 */
.casethumb img {
    transition: all 0.5s ease;
}

.case-item:hover .casethumb img {
    transform: scale(1.1);
}

/* 按钮动画效果 */
.icasemore {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.icasemore::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.icasemore:hover::before {
    left: 100%;
}

.icasemore:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 194, 209, 0.3);
}

/* 响应式图片 */
img {
    max-width: 100%;
    height: auto;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 应用动画类 */
.fade-in-up {
    animation: fadeInUp 0.8s ease;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease;
}

/* 响应式字体大小 */
@media (max-width: 767px) {
    body {
        font-size: 14px;
    }
    
    h2 {
        font-size: 16px !important;
    }
    
    h3 {
        font-size: 18px !important;
    }
    
    .itit span {
        font-size: 10px !important;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .service-item:hover,
    .case-item:hover,
    .news-item:hover {
        transform: none;
    }
    
    .back-to-top:hover {
        transform: none;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo a {
        background-size: contain;
    }
    
    .serico {
        background-size: contain;
    }
}

/* 打印样式 */
@media print {
    .header,
    .mobile-nav-toggle,
    .back-to-top,
    .links {
        display: none !important;
    }
    
    .banner {
        height: auto !important;
        margin-top: 0 !important;
    }
    
    body {
        background: #fff !important;
        color: #000 !important;
    }
}
