/* 九宫格线条修复修正版 - 基于实际HTML结构精确定位 */

/* 全局重置 */
#table3,
#table3 * {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
}

/* 强制清除所有边框 */
#table3 {
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    background-color: transparent !important;
}

#table3 tr {
    border: none !important;
}

#table3 td {
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    background-color: transparent !important;
    padding: 3px !important;
}

/* 精确定位九宫格区域（第3-5行，第2-4列）- 修正定位 */
#table3 tr:nth-child(3) td:nth-child(2),
#table3 tr:nth-child(3) td:nth-child(3),
#table3 tr:nth-child(3) td:nth-child(4),
#table3 tr:nth-child(4) td:nth-child(2),
#table3 tr:nth-child(4) td:nth-child(3),
#table3 tr:nth-child(4) td:nth-child(4),
#table3 tr:nth-child(5) td:nth-child(2),
#table3 tr:nth-child(5) td:nth-child(3),
#table3 tr:nth-child(5) td:nth-child(4) {
    border: 1px solid #e0e0e0 !important;  /* 改为浅灰色避免黑线 */
    background-color: #f8f9fa !important;    /* 统一背景色 */
    padding: 3px !important;
}

/* 移除所有内联样式影响 */
#table3 td[style*="border"] {
    border: none !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
}

#table3 td[style*="background-color"] {
    background-color: transparent !important;
}

/* 保持原有布局 */
#table3 {
    width: 100% !important;
    table-layout: fixed !important;
    margin: 0 auto !important;
}

#table3 td {
    font-size: inherit !important;
    text-align: inherit !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

/* 九宫格字体精调优化 */
@media screen and (max-width: 768px) {
    /* 表格整体设置 */
    #table3 {
        width: 95% !important;
        max-width: 400px !important;
        margin: 0 auto !important;
    }
    
    /* 所有单元格统一设置 */
    #table3 td {
        height: 60px !important;
        line-height: 1.5 !important;  /* 增加行间距 */
        font-size: 15px !important;   /* 减少1px */
        font-family: 'Microsoft YaHei', '微软雅黑', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
        padding: 6px 4px !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        display: table-cell !important;
        vertical-align: middle !important;
        font-weight: normal !important;
    }
    
    /* 九宫格区域 */
    #table3 tr:nth-child(n+3):nth-child(-n+5) td:nth-child(n+2):nth-child(-n+4) {
        width: 33.33% !important;
        height: 65px !important;
        background: #f8f9fa !important;
        font-size: 16px !important;   /* 减少1px */
        line-height: 1.5 !important;  /* 增加行间距 */
        font-family: 'Microsoft YaHei', '微软雅黑', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
        font-weight: normal !important;
    }
    
    /* 中宫特殊处理 - 白色透明round.jpg覆盖 */
    #table3 tr:nth-child(4) td:nth-child(3) {
        position: relative !important;
        background: none !important;
        overflow: hidden !important;
    }
    
    #table3 tr:nth-child(4) td:nth-child(3)::before {
        content: '' !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background-image: url('round.jpg') !important;
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        opacity: 0.3 !important;  /* 白色透明效果 */
        z-index: 1 !important;
    }
    
    #table3 tr:nth-child(4) td:nth-child(3) * {
        position: relative !important;
        z-index: 2 !important;
    }
}

@media screen and (max-width: 480px) {
    #table3 {
        width: 98% !important;
        max-width: 320px !important;
    }
    
    #table3 td {
        height: 55px !important;
        line-height: 1.4 !important;  /* 增加行间距 */
        font-size: 14px !important;   /* 减少1px */
        font-family: 'Microsoft YaHei', '微软雅黑', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
        padding: 5px 3px !important;
        font-weight: normal !important;
    }
    
    #table3 tr:nth-child(n+3):nth-child(-n+5) td:nth-child(n+2):nth-child(-n+4) {
        height: 60px !important;
        font-size: 15px !important;   /* 减少1px */
        line-height: 1.4 !important;  /* 增加行间距 */
        font-family: 'Microsoft YaHei', '微软雅黑', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
        font-weight: normal !important;
    }
}

@media screen and (max-width: 375px) {
    #table3 {
        width: 100% !important;
        max-width: 300px !important;
    }
    
    #table3 td {
        height: 50px !important;
        line-height: 1.3 !important;  /* 增加行间距 */
        font-size: 13px !important;   /* 减少1px */
        font-family: 'Microsoft YaHei', '微软雅黑', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
        padding: 4px 2px !important;
        font-weight: normal !important;
    }
    
    #table3 tr:nth-child(n+3):nth-child(-n+5) td:nth-child(n+2):nth-child(-n+4) {
        height: 55px !important;
        font-size: 14px !important;   /* 减少1px */
        line-height: 1.3 !important;  /* 增加行间距 */
        font-family: 'Microsoft YaHei', '微软雅黑', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
        font-weight: normal !important;
    }
}

/* 确保图片自适应 */
#table3 img {
    max-width: 100% !important;
    max-height: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
}

/* 统一所有表格样式 */
#table1, #table2, #table3 {
    table-layout: fixed !important;
    width: 100% !important;
    border-collapse: collapse !important;
}

#table1 td, #table2 td, #table3 td {
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* 移动端黑线修复 */
@media screen and (max-width: 768px) {
    #table3 {
        -webkit-transform: translateZ(0);  /* 强制硬件加速 */
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-perspective: 1000;
        perspective: 1000;
        border-spacing: 0 !important;  /* 彻底消除间距 */
    }
    
    #table3 tr:nth-child(n+3):nth-child(-n+5) td:nth-child(n+2):nth-child(-n+4) {
        border: 0.5px solid #f0f0f0 !important;  /* 更细的边框 */
        background-clip: padding-box !important;  /* 防止背景溢出 */
        -webkit-background-clip: padding-box !important;
        box-shadow: none !important;  /* 移除阴影 */
        -webkit-box-shadow: none !important;
    }
    
    /* 修复图片下方黑线 */
    #table3 img {
        vertical-align: top !important;  /* 消除图片底部空隙 */
        display: block !important;
        margin: 0 auto !important;
        -webkit-user-select: none !important;
        user-select: none !important;
    }
    
    /* 强制隐藏所有可能的黑线 */
    #table3 td {
        outline: none !important;
        -webkit-tap-highlight-color: transparent !important;
        -webkit-focus-ring-color: transparent !important;
        -webkit-user-select: none !important;
        user-select: none !important;
    }
    
    /* 修复中宫黑线 - 使用背景色重叠 */
    #table3 tr:nth-child(4) td:nth-child(3) {
        position: relative !important;
        overflow: hidden !important;
    }
    
    #table3 tr:nth-child(4) td:nth-child(3)::before {
        content: '' !important;
        position: absolute !important;
        top: -1px !important;
        left: -1px !important;
        right: -1px !important;
        bottom: -1px !important;
        background-image: url('round.jpg') !important;
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        opacity: 0.3 !important;
        z-index: -1 !important;
    }
}