/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family:"宋体";
}

body {
    font-family: 'Arial', sans-serif;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    background-color: #f9f9f9;
}

/* 全局图片设置 - 最大宽度100% */
img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 840px;
    margin: 0 auto;
    background-color: white;
    padding: 40px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

    /* 关键样式：禁用特定div的编辑边框 */
    .container.print-section[contenteditable="true"]:focus {
        outline: none;
        box-shadow: none;
    }

/* 增强内部元素的编辑视觉反馈 */
[contenteditable="true"]:not(.container):focus {
    outline: 1px dashed #666;
    background-color: rgba(255, 255, 220, 0.3);
}

/* 页眉样式 */
.print-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #666;
}

.print-logo img {
    max-height: 30px;
}

.print-company {
    text-align: right;
}

.print-company-name {
    font-size: 24px;
    color: #333;
    font-weight: bold;
}

/* 标题样式 */
.print-title {
    font-size: 20px;
    background-color: #049;
    color: white;
    padding: 10px 0;
    text-align: center;
    margin: 0 0 30px 0;
    border-radius: 4px;
}

/* 内容区域样式 */
.product-image {
    text-align: center;
    margin: 0 0 30px 0;
}

    .product-image img {
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

.section {
    margin-bottom: 30px;
}

    .section h2 {
        color: #049;
        margin-bottom: 15px;
        padding-bottom: 5px;
        border-bottom: 1px solid #ddd;
        font-size: 20px;
    }

    .section p {
        font-size: 15px;
        line-height: 2;
    }

/* 表格样式 */
table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 15px 0 25px 0;
    font-size: 14px;
    
}
    table tr:nth-child(1) {
        background: #049;
    }

        table tr:nth-child(1) td {
            color: #FFF;
        }

    table td, table p {
        /* 强制所有单元格内的文本使用相同字体大小 */
        font-size: 14px !important;
        line-height: 1.5; /* 统一行高 */
        font-family: 'Arial', sans-serif; /* 统一字体 */
    }

    table td {
        border: 1px solid #ccc;
        padding: 8px 1px;
        text-align: center;
        font-size: 14px;
    }

    table tr:nth-child(even) {
        background-color: #f5f5f5;
    }

/* 打印按钮 */
.print-btn {
    background: #049;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    transition: background 0.3s;
}

    .print-btn:hover {
        background: #049;
    }

/* 打印样式 */
@media print {
    body {
        background-color: white;
        padding: 0;
        margin: 0;
    }

   
    .container {
        width: 100%;
        padding: 0;
        box-shadow: none;
        margin: 0;
    }

    .print-btn {
        display: none;
    }

    @page {
        size: A4;
        margin: 15mm;
    }

    /* 确保所有内容在一页内 */
    .print-section {
        page-break-inside: avoid;
    }

    /* 图片打印样式 - 居中且最大宽度100% */
    img {
        display: block;
        margin: 0 auto !important;
        max-width: 100% !important;
        height: auto !important;
    }

    /* 调整打印字体和行高 */
    p {
        font-size: 14px;
        line-height: 1.5;
        color: #333;
    }

    h2 {
        font-size: 14pt;
        color: #049;
    }

    table {
        font-size: 14px;
    }

        table tr:nth-child(1) {
            background: #049;
        }

            table tr:nth-child(1) td {
                color: #FFF;
            }
            table tr:nth-child(1) td p{
                color: #FFF !important;
            }

    /* 页眉页脚调整 */
    .print-header {
        margin-bottom: 20px;
        padding-bottom: 10px;
    }

    .print-title {
        margin-bottom: 20px;
        padding: 8px 0;
    }
}
