/* 首页板块标题手机端对齐修复 */

/* 通用标题样式 - 手机端靠左显示 */
@media (max-width: 768px) {
    /* 热门产品板块标题 */
    .widget-title {
        text-align: left !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    .widget-title .box-title {
        text-align: left !important;
        font-size: 28px !important;
        line-height: 32px !important;
    }
    
    .widget-title .box-title .title {
        padding: 0 !important;
        text-align: left !important;
    }
    
    /* 激光机必要工具标题 */
    .index_title {
        text-align: left !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        font-size: 28px !important;
        line-height: 32px !important;
        margin: 0.4rem 0 0.35rem 0 !important;
    }
    
    /* 最先进行业产品标题 - 优化字体大小确保两行显示 */
    .kuanwei .titzong {
        text-align: left !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        font-size: 20px !important; /* 从28px减小到20px */
        line-height: 1.4 !important; /* 优化行高 */
        width: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 60px !important;
        /* 强制两行显示 */
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        /* 确保文字能够正确换行 */
        word-wrap: break-word !important;
        hyphens: auto !important;
    }
    
    /* 金属加工第一激光品牌标题 */
    .kuanwei1 .titzong {
        text-align: left !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        font-size: 28px !important;
        line-height: 32px !important;
        width: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 60px !important;
    }
    
    /* 媒体喜爱标题 */
    .kuanwei2 .titzong {
        text-align: left !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        font-size: 28px !important;
        line-height: 32px !important;
        width: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 60px !important;
    }
    
    /* 为什么选择标题 */
    .kuanwei2:last-of-type .titzong {
        text-align: left !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        font-size: 28px !important;
        line-height: 32px !important;
        width: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 60px !important;
    }
    
    /* 标题描述文字 */
    .titdesc {
        text-align: left !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        font-size: 16px !important;
        line-height: 24px !important;
        margin-top: 20px !important;
        margin-bottom: 30px !important;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .widget-title .box-title {
        font-size: 24px !important;
        line-height: 28px !important;
    }
    
    .index_title {
        font-size: 24px !important;
        line-height: 28px !important;
    }
    
    .kuanwei .titzong,
    .kuanwei1 .titzong,
    .kuanwei2 .titzong {
        font-size: 24px !important;
        line-height: 28px !important;
    }
    
    /* 超小屏幕下进一步优化最先进行业产品标题 */
    .kuanwei .titzong {
        font-size: 18px !important; /* 进一步减小字体 */
        line-height: 1.5 !important; /* 优化行高 */
    }
    
    .widget-title,
    .index_title,
    .kuanwei .titzong,
    .kuanwei1 .titzong,
    .kuanwei2 .titzong {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* 平板端优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .widget-title .box-title {
        font-size: 32px !important;
        line-height: 36px !important;
    }
    
    .index_title {
        font-size: 32px !important;
        line-height: 36px !important;
    }
    
    .kuanwei .titzong,
    .kuanwei1 .titzong,
    .kuanwei2 .titzong {
        font-size: 32px !important;
        line-height: 36px !important;
        width: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 30px !important;
        padding-right: 30px !important;
    }
}

/* 确保标题容器在手机端有正确的边距 */
@media (max-width: 768px) {
    .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* 标题容器的左边距 */
    .widget-title,
    .index_title,
    .kuanwei,
    .kuanwei1,
    .kuanwei2 {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* 修复特定板块的标题对齐 */
@media (max-width: 768px) {
    /* 热门产品板块 */
    .indexbox .widget-title {
        text-align: left !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    /* 激光机必要工具板块 */
    .layout_style_surfup .index_title {
        text-align: left !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    /* 激光机必要工具板块内容居中 */
    .layout_style_surfup .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    .layout_style_surfup .new-grid {
        justify-content: center !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* 确保网格项目在手机端居中显示 */
    .layout_style_surfup .shopify-section-add01 .grid-item {
        margin-left: auto !important;
        margin-right: auto !important;
        flex: 0 0 auto !important;
    }
    
    /* 覆盖原有的负边距 */
    .layout_style_surfup .shopify-section-add01 .new-grid {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* 确保手机端网格项目正确显示 - 保持两列布局 */
    .layout_style_surfup .shopify-section-add01 .grid-item {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding: 0 5px !important;
        box-sizing: border-box !important;
    }
    
    /* 确保网格容器在手机端居中且保持两列布局 */
    .layout_style_surfup .shopify-section-add01 .new-grid {
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 400px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* 最先进行业产品板块 */
    .kuanwei .titzong {
        text-align: left !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    /* 金属加工第一激光品牌板块 */
    .kuanwei1 .titzong {
        text-align: left !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    /* 媒体喜爱板块 */
    .kuanwei2:first-of-type .titzong {
        text-align: left !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    /* 为什么选择板块 */
    .kuanwei2:last-of-type .titzong {
        text-align: left !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

/* 特殊板块标题样式 - "Introduce The Most Advanced Industry Products" */
/* 使用更高优先级的选择器来覆盖index.css中的样式 */
/* 桌面端样式 */
body .kuanwei .titzong,
html body .kuanwei .titzong,
div.kuanwei .titzong {
    font-size: 32px !important;
    line-height: 1.3 !important;
    max-width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    word-wrap: break-word !important;
    hyphens: auto !important;
}

/* 平板端样式 */
@media (min-width: 769px) and (max-width: 1024px) {
    body .kuanwei .titzong,
    html body .kuanwei .titzong,
    div.kuanwei .titzong {
        font-size: 28px !important;
        line-height: 1.4 !important;
        max-width: 700px !important;
    }
}

/* 手机端样式 - 使用更高优先级覆盖index.css */
@media (max-width: 768px) {
    body .kuanwei .titzong,
    html body .kuanwei .titzong,
    div.kuanwei .titzong {
        font-size: 20px !important; /* 确保字体大小适合两行显示 */
        line-height: 1.4 !important;
        max-width: 100% !important;
        text-align: left !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 60px !important;
        /* 强制两行显示 */
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        /* 覆盖index.css中的样式 */
        width: auto !important;
        /* 确保文字能够正确换行 */
        word-wrap: break-word !important;
        hyphens: auto !important;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    body .kuanwei .titzong,
    html body .kuanwei .titzong,
    div.kuanwei .titzong {
        font-size: 18px !important; /* 超小屏幕进一步减小字体 */
        line-height: 1.5 !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* 确保在所有设备上都支持两行显示 */
body .kuanwei .titzong,
html body .kuanwei .titzong,
div.kuanwei .titzong {
    /* 设置最大宽度，确保文字能够换行 */
    max-width: 800px !important;
    /* 允许文字换行 */
    white-space: normal !important;
    /* 设置行高，确保两行显示效果 */
    line-height: 1.3 !important;
}

/* 针对index.css中的@media (max-width: 1199px)规则进行覆盖 */
@media (max-width: 1199px) {
    body .kuanwei .titzong,
    html body .kuanwei .titzong,
    div.kuanwei .titzong {
        /* 覆盖index.css中的font-size: 22px */
        font-size: 28px !important;
        /* 覆盖index.css中的text-align: center */
        text-align: center !important;
        /* 覆盖index.css中的width: auto */
        width: auto !important;
        /* 添加我们的自定义样式 */
        line-height: 1.4 !important;
        max-width: 800px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* 手机端特殊覆盖 */
@media (max-width: 768px) {
    body .kuanwei .titzong,
    html body .kuanwei .titzong,
    div.kuanwei .titzong {
        /* 强制覆盖所有其他样式 */
        font-size: 20px !important; /* 确保字体大小适合两行显示 */
        text-align: left !important;
        width: auto !important;
        line-height: 1.4 !important;
        max-width: 100% !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 60px !important;
        /* 强制两行显示 */
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        /* 确保文字能够正确换行 */
        word-wrap: break-word !important;
        hyphens: auto !important;
    }
}

/* 超小屏幕进一步优化 */
@media (max-width: 480px) {
    body .kuanwei .titzong,
    html body .kuanwei .titzong,
    div.kuanwei .titzong {
        font-size: 18px !important; /* 超小屏幕进一步减小字体 */
        line-height: 1.5 !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
} 