/* 移动端电话链接颜色修复和图片自适应 */
/* Phone Links Color Fix and Image Responsive for Mobile */

/* ========== 图片自适应修复 ========== */
@media (max-width: 1024px) {
    /* 确保所有图片完全自适应 */
    img,
    .image-zoom-container img,
    .company-images-grid img {
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
        object-fit: contain !important;
    }

    /* 图片容器自适应 */
    .image-zoom-container,
    .company-images-grid {
        max-width: 100% !important;
        overflow: hidden !important;
        border-radius: 8px;
    }

    /* 网格布局自适应 */
    .company-images-grid,
    .technology-images-grid,
    .endorsement-images-grid,
    .cooperation-images-grid,
    .product-principle-images,
    .product-details-images {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    /* 超小屏幕进一步优化 */
    @media (max-width: 374px) {
        .company-images-grid {
            gap: 10px !important;
            padding: 0 5px;
        }
    }
}

/* ========== 电话链接颜色修复 ========== */

/* 强制所有电话链接为白色 */
@media (max-width: 1024px) {
    /* 电话链接强制白色 */
    a[href^="tel:"] {
        color: white !important;
        text-decoration: none !important;
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        pointer-events: auto !important;
    }

    /* 所有状态的颜色 */
    a[href^="tel:"]:link,
    a[href^="tel:"]:visited,
    a[href^="tel:"]:active,
    a[href^="tel:"]:hover,
    a[href^="tel:"]:focus {
        color: white !important;
        text-decoration: none !important;
    }

    /* 悬停时显示下划线 */
    a[href^="tel:"]:hover {
        text-decoration: underline !important;
    }

    /* 邮箱链接 */
    a[href^="mailto:"] {
        color: rgba(255, 255, 255, 0.9) !important;
        text-decoration: none !important;
    }

    a[href^="mailto:"]:hover {
        color: white !important;
        text-decoration: underline !important;
    }

    /* 移除移动浏览器的高亮效果 */
    a[href^="tel:"],
    a[href^="mailto:"] {
        -webkit-tap-highlight-color: transparent;
        outline: none;
    }

    /* 防止浏览器自动链接检测的颜色覆盖 */
    .header-top a,
    .footer a,
    .mobile-nav-footer a {
        color: white !important;
    }

    /* 移除可能的浏览器默认样式 */
    a[href^="tel:"]::-webkit-any-link,
    a[href^="mailto:"]::-webkit-any-link {
        color: white !important;
    }

    /* 确保文本节点不会变蓝 */
    .header-top span,
    .footer span,
    .mobile-nav-footer span {
        color: inherit !important;
    }
}

/* 针对Safari的特殊处理 */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 1024px) {
        a[href^="tel:"] {
            -webkit-touch-callout: default;
            color: white !important;
        }

        a[href^="tel:"]:active {
            color: white !important;
            opacity: 0.8;
        }
    }
}

/* 针对Chrome的特殊处理 */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    @media (max-width: 1024px) {
        a[href^="tel:"] {
            color: white !important;
        }
    }
}