/* 移动端优化样式 */
/* Mobile Optimization Styles for 南宁惠丰智投科技有限公司 */

/* 基础移动端样式重置 */
@media (max-width: 768px) {
    /* 基础布局优化 */
    body {
        font-size: 14px;
        line-height: 1.6;
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    /* 容器宽度优化 */
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px;
        padding-right: 15px;
        box-sizing: border-box;
    }
    
    /* 导航菜单移动端优化 */
    .xg_menu {
        position: relative;
    }
    
    .xg_menuMobile {
        display: block !important;
        position: relative;
        z-index: 1000;
    }
    
    .xg_memu_btn {
        display: block;
        width: 30px;
        height: 30px;
        background: #333;
        position: relative;
        cursor: pointer;
        border-radius: 3px;
        margin: 10px auto;
    }
    
    .xg_memu_btn::before,
    .xg_memu_btn::after,
    .xg_memu_btn span {
        content: '';
        position: absolute;
        width: 20px;
        height: 2px;
        background: #fff;
        left: 5px;
        transition: all 0.3s ease;
    }
    
    .xg_memu_btn::before {
        top: 8px;
    }
    
    .xg_memu_btn span {
        top: 14px;
    }
    
    .xg_memu_btn::after {
        top: 20px;
    }
    
    .xg_menuPanel {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        border-radius: 5px;
        display: none;
        z-index: 999;
    }
    
    .xg_menuPanel.active {
        display: block;
    }
    
    .xg_menuPanel ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .xg_menuPanel li {
        border-bottom: 1px solid #eee;
    }
    
    .xg_menuPanel li:last-child {
        border-bottom: none;
    }
    
    .xg_menuPanel a {
        display: block;
        padding: 15px 20px;
        color: #333;
        text-decoration: none;
        font-size: 16px;
        transition: background-color 0.3s ease;
    }
    
    .xg_menuPanel a:hover {
        background-color: #f5f5f5;
    }
    
    /* 轮播图移动端优化 */
    .xg_banner {
        height: auto !important;
        min-height: 200px;
        position: relative;
        overflow: hidden;
        border-radius: 8px;
        margin: 10px 0;
    }
    
    .xg_banner_item {
        height: auto !important;
        min-height: 200px;
        position: relative;
    }
    
    .xg_banner_img {
        height: auto !important;
        min-height: 200px;
        position: relative;
        overflow: hidden;
    }
    
    .xg_banner_img img {
        width: 100% !important;
        height: auto !important;
        object-fit: cover;
        transition: transform 0.3s ease;
    }
    
    /* 轮播图指示器优化 */
    .slick-dots {
        bottom: 10px !important;
        text-align: center;
    }
    
    .slick-dots li {
        width: 12px !important;
        height: 12px !important;
        margin: 0 4px !important;
    }
    
    .slick-dots li button {
        width: 12px !important;
        height: 12px !important;
        border-radius: 50% !important;
        background: rgba(255,255,255,0.5) !important;
        border: none !important;
    }
    
    .slick-dots li.slick-active button {
        background: #fff !important;
    }
    
    /* 轮播图触摸优化 */
    .xg_banner .slick-track {
        touch-action: pan-y;
    }
    
    /* 轮播图加载状态 */
    .xg_banner_loading {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
    }
    
    @keyframes loading {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }
    
    /* 产品展示区域优化 */
    .xg_tab_l_t ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .xg_tab_tl {
        flex: 1;
        min-width: 120px;
        text-align: center;
        margin: 5px;
        font-size: 14px;
    }
    
    .data_col {
        margin-bottom: 20px;
    }
    
    /* 图片响应式优化 */
    .xg_img img {
        max-width: 100% !important;
        height: auto !important;
        display: block;
        margin: 0 auto;
    }
    
    /* 文字大小优化 */
    .xg_text {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .xg_text span {
        word-wrap: break-word;
        word-break: break-all;
    }
    
    /* 按钮优化 */
    .xg_ibtn input,
    .xg_ibtn a {
        padding: 12px 20px;
        font-size: 16px;
        border-radius: 5px;
        min-height: 44px; /* 确保触摸目标足够大 */
        display: block;
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
    
    /* 新闻列表优化 */
    .xg_list .data_row {
        margin-bottom: 15px;
        padding: 15px;
        border: 1px solid #eee;
        border-radius: 5px;
        background: #fafafa;
    }
    
    /* 联系我们页面优化 */
    .xg_text iframe {
        width: 100% !important;
        height: 300px !important;
        border: none;
        border-radius: 5px;
    }
    
    /* 页脚优化 */
    .xg_footer {
        text-align: center;
        padding: 20px 15px;
        background: #f8f9fa;
        border-top: 1px solid #e9ecef;
    }
    
    .xg_footer .container {
        padding: 0;
    }
    
    /* 页脚导航优化 */
    .xg_footer .xg_bnavi {
        margin-bottom: 20px;
    }
    
    .xg_footer .xg_menuUl {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .xg_footer .xg_menuLi1 {
        margin: 0;
    }
    
    .xg_footer .xg_menuA1 {
        display: block;
        padding: 10px 15px;
        color: #333;
        text-decoration: none;
        border-radius: 5px;
        transition: all 0.3s ease;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .xg_footer .xg_menuA1:hover,
    .xg_footer .xg_menuA1:active {
        background: #007bff;
        color: #fff;
    }
    
    /* 页脚联系信息优化 */
    .xg_footer .xg_text {
        margin: 10px 0;
        font-size: 14px;
        line-height: 1.6;
    }
    
    .xg_footer .xg_text span {
        display: block;
        margin: 5px 0;
        word-break: break-all;
    }
    
    /* 页脚响应式布局 */
    .xg_footer .row {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .xg_footer .col-sm-12,
    .xg_footer .col-lg-2,
    .xg_footer .col-lg-6,
    .xg_footer .col-lg-4 {
        width: 100%;
        margin-bottom: 15px;
    }
    
    /* 隐藏不必要的元素 */
    .mobile_hide {
        display: none !important;
    }
    
    /* 友情链接在移动端隐藏 */
    .xg_flink {
        display: none !important;
    }
}

/* 超小屏幕优化 (iPhone SE等) */
@media (max-width: 480px) {
    body {
        font-size: 13px;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .xg_text {
        font-size: 13px;
    }
    
    .xg_tab_tl {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .xg_menuPanel a {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .data_col {
        margin-bottom: 15px;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .xg_banner {
        min-height: 150px;
    }
    
    .xg_banner_img {
        min-height: 150px;
    }
    
    .xg_menuPanel {
        max-height: 60vh;
        overflow-y: auto;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    /* 触摸设备专用样式 */
    .xg_menuA1,
    .xg_tab_tl,
    .xg_ibtn input,
    .xg_ibtn a {
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
        transition: background-color 0.2s ease;
    }
    
    .xg_menuA1:active,
    .xg_tab_tl:active,
    .xg_ibtn input:active,
    .xg_ibtn a:active {
        background-color: rgba(0,0,0,0.1);
    }
    
    /* 增加触摸目标大小 */
    .xg_menuA1 {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 轮播图触摸手势优化 */
    .xg_banner {
        touch-action: pan-y pinch-zoom;
    }
    
    /* 防止意外缩放 */
    .xg_banner img {
        touch-action: manipulation;
    }
    
    /* 触摸反馈增强 */
    .xg_banner_item:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* 手势导航优化 */
@media (max-width: 768px) {
    /* 滑动指示器 */
    .swipe-indicator {
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        color: rgba(255,255,255,0.8);
        font-size: 12px;
        animation: swipe-hint 2s infinite;
    }
    
    @keyframes swipe-hint {
        0%, 100% { opacity: 0.5; }
        50% { opacity: 1; }
    }
    
    /* 触摸滚动优化 */
    .xg_banner .slick-track {
        -webkit-overflow-scrolling: touch;
    }
    
    /* 防止滚动穿透 */
    .xg_menuPanel.active {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        overflow-y: auto;
    }
    
    /* 菜单打开时禁止背景滚动 */
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .xg_img img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .xg_menuPanel {
        background: #333;
        color: #fff;
    }
    
    .xg_menuPanel a {
        color: #fff;
    }
    
    .xg_menuPanel a:hover {
        background-color: #555;
    }
    
    .xg_menuPanel li {
        border-bottom-color: #555;
    }
    
    .xg_list .data_row {
        background: #333;
        border-color: #555;
        color: #fff;
    }
}

/* 减少动画效果（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 移动端性能优化 */
@media (max-width: 768px) {
    /* 硬件加速 */
    .xg_banner,
    .xg_banner_item,
    .xg_banner_img,
    .xg_menuPanel {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        will-change: transform;
    }
    
    /* 优化滚动性能 */
    .xg_banner .slick-track {
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
    }
    
    /* 减少重绘 */
    .xg_banner_img img {
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
    
    /* 优化字体渲染 */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
    
    /* 优化触摸滚动 */
    .xg_menuPanel {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

/* 移动端加载优化 */
@media (max-width: 768px) {
    /* 关键资源预加载提示 */
    .xg_banner_img img[data-src] {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading-shimmer 1.5s infinite;
    }
    
    @keyframes loading-shimmer {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }
    
    /* 图片加载完成后的过渡效果 */
    .xg_banner_img img.loaded {
        opacity: 0;
        animation: fadeIn 0.3s ease-in-out forwards;
    }
    
    @keyframes fadeIn {
        to { opacity: 1; }
    }
}

/* 打印样式优化 */
@media print {
    .xg_menu,
    .xg_menuMobile,
    .xg_banner,
    .xg_ibtn {
        display: none !important;
    }
    
    .container {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
    }
    
    .xg_text {
        font-size: 12pt !important;
        line-height: 1.4 !important;
    }
    
    body {
        font-size: 12pt !important;
        color: #000 !important;
        background: #fff !important;
    }
}
