@page {
    size: A4 portrait;
    margin: 10mm;
    @top-center {
        content: "";
    }
}

body {
    font-family: "Microsoft YaHei", sans-serif;
    margin: 0;
    padding: 0;
    width: 210mm;
    height: auto;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    font-size: 12px;
    color: #000;
    background-color: #fff;
}

.container {
    width: 100%;
    min-height: 100%;
    padding: 10mm 10mm 5mm; /* 顶部留空 10mm */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.certificate {
    flex: 0 0 25%;
    margin-bottom: 5px;
    border: 2px solid #000;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    page-break-inside: avoid;
}

.report {
    flex: 1;
    border: 2px solid #000;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    page-break-inside: avoid;
}

.company-name {
    text-align: center;
    font-size: 24px; /* 增大字号 */
    font-weight: bold;
    margin-bottom: 5px;
    color: #000;
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    padding: 0 10px;
}

.header {
    text-align: center;
    margin-bottom: 6px;
    margin-top: 20px;
}

.header h1 {
    margin: 3px 0;
    font-size: 18px;
    color: #000;
}

.header h2 {
    margin: 3px 0;
    font-size: 14px;
    color: #000;
}

.info-table {
    width: 98%;
    margin: 0 auto 6px;
    border-collapse: collapse;
}

.info-table td {
    border: 1px solid #000;
    padding: 3px;
    height: 22px;
}

.section-title {
    padding: 3px;
    margin: 6px 0 3px;
    font-weight: bold;
    border-bottom: 2px solid #000;
    color: #000;
    font-size: 14px;
}

.test-table {
    width: 98%;
    margin: 0 auto 6px;
    border-collapse: collapse;
}

.test-table th,
.test-table td {
    border: 1px solid #000;
    padding: 3px;
    text-align: center;
}

.test-table th {
    border-bottom: 2px solid #000;
    background-color: transparent;
    color: #000;
}

.test-table:nth-of-type(2) th:nth-child(1) {
    width: 30%;
}

.test-table:nth-of-type(2) th:nth-child(2) {
    width: 15%;
}

.test-table:nth-of-type(2) th:nth-child(3) {
    width: 25%;
}

.test-table:nth-of-type(2) th:nth-child(4) {
    width: 15%;
}

.test-table:nth-of-type(2) th:nth-child(5) {
    width: 15%;
}

.test-table:not(:nth-of-type(2)) th:nth-child(1) {
    width: 25%;
}

.test-table:not(:nth-of-type(2)) th:nth-child(2) {
    width: 25%;
}

.test-table:not(:nth-of-type(2)) th:nth-child(3) {
    width: 25%;
}

.test-table:not(:nth-of-type(2)) th:nth-child(4) {
    width: 25%;
}

.test-table:not(:nth-of-type(2)) th:nth-child(5) {
    width: 25%;
}

.signature {
    text-align: right;
    margin-top: 8px;
    font-size: 12px;
}

.stamp {
    text-align: center;
    margin: 10px 0;
    font-size: 12px;
}

.style-switcher {
    background-color: #f9f9f9;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    cursor: move;
    width: 200px;
    max-height: 200px;
    overflow-y: auto;
}

/* 电脑端样式 */
@media (min-width: 768px) {
    .style-switcher {
        position: fixed;
        top: 10px;
        right: 10px;
        left: auto;
        bottom: auto;
    }
}

/* 手机端样式 */
@media (max-width: 767px) {
    .style-switcher {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 300px;
    }
}

.style-switcher h3 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #333;
}

.style-switcher button {
    display: block;
    width: 100%;
    margin: 5px 0;
    padding: 10px 15px;
    cursor: pointer;
    background-color: #e0e0e0;
    border: 1px solid #ccc;
    border-radius: 5px;
    color: #333;
}

@media print {
    .style-switcher {
        display: none;
    }
    .container {
        height: auto;
        overflow: visible;
    }
}

.style-black .section-title,
.style-black .test-table th,
.style-black .info-table td:first-child,
.style-black .header {
    color: #000;
}

/* 无界主题样式 */
.style-unbounded .certificate,
.style-unbounded .report {
    border: none;
    box-shadow: none;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-size: 16px;
}

.modal-content select,
.modal-content input {
    padding: 10px;
    font-size: 16px;
}

/* 增大应用选择修改按钮的高度 */
.modal-content button {
    padding: 20px 15px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.error-message {
    color: red;
    margin-top: 10px;
}
    