﻿html, body {
        height: 100%;
        margin: 0;
        padding: 0;
    }
    /* ========== 顶部页眉 90px 通栏 ========== */
    .header {
        width: 100%;
        height: 90px;
        background: linear-gradient(to right, #ffffff 0%, #abc9b8 100%);
        display: flex;
        align-items: center;
        padding: 0 20px;
        box-sizing: border-box;
        position: relative;
    }
    .menu-toggle {
        display: none;
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        border: none;
        background: #1f7042;
        color: #fff;
        border-radius: 6px;
        font-size: 22px;
        cursor: pointer;
        z-index: 99;
    }
    .header img {
        height: 90px;
        object-fit: contain;
    }
    .main {
        display: flex;
        height: calc(100% - 90px);
        background-color: #fff;
    }
    /* ========== 左侧绿色分级菜单 ========== */
    .left-nav {
        width: 240px;
        background: #1f7042;
        color: #fff;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        transition: width 0.3s ease, visibility 0.3s;
        flex-shrink: 0;
    }
    .nav-item { border-bottom: 1px solid #1a6239; }
    .nav-level1 {
        padding: 14px 20px;
        cursor: pointer;
        font-size: 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
        transition: background 0.25s ease;
    }
    .nav-level1::before {
        content: "";
        position: absolute;
        left: 0;
        top: 10px;
        bottom: 10px;
        width: 4px;
        background: #4cd088;
        border-radius: 0 3px 3px 0;
        opacity: 0;
        transition: opacity 0.25s;
    }
    .nav-level1:hover::before { opacity: 1; }
    .nav-level1:hover { background: #26854f; }
    .nav-level1 span {
        font-size: 18px;
        width: 22px;
        text-align: center;
        transition: transform 0.2s;
    }
    .nav-level2 {
        display: none;
        background: #2b9459;
    }
    .nav-item.open .nav-level2 { display: block; }
    .nav-level2 a {
        display: block;
        padding: 11px 32px;
        color: #fff;
        text-decoration: none;
        font-size: 14px;
        transition: background 0.2s, border-left-color 0.2s;
        border-left: 3px solid transparent;
        border-bottom: 1px solid #24844f;
    }
    .nav-level2 a:last-child { border-bottom: none; }
    .nav-level2 a:hover {
        background: #009b8b;
        border-left-color: #8cf0b4;
    }
    .nav-level2 a.active {
        background: #187c72;
        border-left-color: #3ee0d0;
    }
    .main-content {
        flex: 1;
        padding: 20px 0;
        overflow-y: auto;
        overflow-x: hidden;
        background: #dadce0;
    }

    /* ========== 控制条 ========== */
    .control-bar {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        background-color: #dadce0;
        padding: 12px 16px;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    .control-bar label {
        font-size: 14px;
        color: #333;
        display: flex;
        align-items: center;
        gap: 4px;
    }
    .control-bar input[type="text"],
    .control-bar select {
        box-sizing: border-box;
        height: 36px;
        padding: 0 10px;
        border: 1px solid #ccc;
        border-radius: 6px;
        font-size: 14px;
        outline: none;
        transition: border 0.2s;
    }
    .control-bar input[type="text"]:focus,
    .control-bar select:focus { border-color: #248a52; }
    .control-bar button {
        height: 36px;
        padding: 0 16px;
        border: none;
        border-radius: 6px;
        background: #248a52;
        color: #fff;
        cursor: pointer;
        font-size: 14px;
        transition: background 0.2s;
    }
    .control-bar button:hover { background: #30a060; }
    .control-bar input[type="checkbox"] {
        width: 16px;
        height: 16px;
        margin: 0;
    }
    .input-number-wrap {
        position: relative;
        height: 36px;
    }
    .input-number-wrap input {
        width: 100%;
        height: 36px;
        box-sizing: border-box;
        padding: 0 24px 0 8px !important;
    }
    .arrow-group {
        position: absolute;
        right: 6px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        flex-direction: column;
        line-height: 1;
    }
    .arrow-up, .arrow-down {
        font-size: 9px;
        color: #666;
        cursor: pointer;
        user-select: none;
    }
    .arrow-up:hover, .arrow-down:hover { color: #248a52; }
    /* 自定义 laydate 主题色 */
    .laydate_body .laydate_table td:hover,
    .laydate_body .laydate_m .laydate_yms span:hover,
    .laydate_body .laydate_time .laydate_hmsno span:hover,
    .laydate_body .laydate_y .laydate_yms ul li:hover {
        background-color: #248a52 !important;
        color: #fff;
    }
    .laydate_body .laydate_click {
        background-color: #248a52 !important;
        color: #fff !important;
    }
    .laydate_body .laydate_btn a:hover {
        color: #248a52 !important;
    }

    /* ========== A4 纸张区域 ========== */
    .paper-wrap {
        width: 210mm;
        margin: 0 auto 20px auto;
    }
    .a4-page {
        width: 210mm;
        height: 297mm;
        background: #fff;
        margin: 0 auto 10px auto;
        padding: 12mm 12mm 14mm 12mm;
        box-sizing: border-box;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        position: relative;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    /* A4 页眉：标题+二维码 一行，信息行在下面，横线划在整个区块底部 */
    .a4-page-header {
        border-bottom: 1.5px solid #333;
        padding-bottom: 6px;
        margin-bottom: 8px;
    }
    .a4-header-top {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }
    .a4-page-title {
        flex: 1;
        font-size: 18pt;
        font-weight: bold;
        text-align: center;
        padding-top: 6px;
        letter-spacing: 2px;
    }
    .a4-qrcode-box {
        width: 22mm;
        height: 22mm;
        flex-shrink: 0;
        border: 1px solid #ccc;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #fff;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;

    }
    .a4-qrcode-box img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    .a4-qrcode-box .qr-label {
        font-size: 7pt;
        color: #666;
        text-align: center;
    }
    /* 信息行：在标题行下面，横线上面 */
    .a4-info-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 11pt;
        margin-top: 6px;
        flex-wrap: wrap;
        gap: 4px;
    }
    .a4-info-row .info-item {
        display: flex;
        align-items: center;
        gap: 2px;
    }
    .a4-info-row .info-blank {
        display: inline-block;
        min-width: 60px;
        border-bottom: 1px solid #333;
        height: 16px;
    }
    .a4-info-row .info-blank.short { min-width: 60px; }
    .a4-info-row .info-blank.score { min-width: 40px; }
    .a4-info-row .info-blank.date { min-width: 100px; }

    /* A4 题目主体 */
    .a4-page-body {
        flex: 1;
        overflow: hidden;
    }
    .tiku table {
        width: 100%;
        border: 0;
        text-align: left;
        font-size: 13pt;
        table-layout: fixed;
        border-collapse: collapse;
    }
    .tiku table tr {
        height: 35px;
    }
    .tiku table tr td {
        width: 25%;
        padding: 0 6px;
        box-sizing: border-box;
        word-break: break-all;
    }
    .blank-box {
        display: inline-block;
        width: 40px;
        height: 18px;
        border: 1px solid #000;
        vertical-align: middle;
    }
    .blank-circle {
        display: inline-block;
        width: 18px;
        height: 18px;
        border: 1px solid #000;
        border-radius: 50%;
        vertical-align: middle;
    }
    .ans-red { color: red; font-weight: bold; }

    /* A4 底部水印 */
    .a4-page-footer {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 4mm;
        text-align: center;
        font-size: 8pt;
        color: #bbb;
        line-height: 1.4;
        pointer-events: none;
    }
    .a4-page-footer .wm-brand {
        /*color: #c9c9c9;*/
        color: #999999;
    }
    .a4-page-footer .wm-time {
        /*color: #d5d5d5;*/
        color: #A0A0A0;
    }

    .btn-green {
        height: 36px;
        padding: 0 16px;
        border: none;
        border-radius: 6px;
        background: #248a52;
        color: #fff;
        cursor: pointer;
        font-size: 14px;
        transition: background 0.2s;
    }
    .btn-green:hover { background: #30a060; }
    .dayin {
        text-align: center;
        padding: 15px 0;
    }

    /* 弹窗提示 */
    .wechat-tip {
        position: fixed;
        left: 0; top: 0;
        width: 100%; height: 100%;
        background: rgba(0,0,0,0.6);
        z-index: 9999;
        display: none;
        align-items: center;
        justify-content: center;
    }
    .tip-box {
        background: #fff;
        padding: 20px;
        border-radius: 10px;
        width: 80%;
        max-width: 340px;
        text-align: center;
    }
    .tip-box h4 { margin-top: 0; }
    .close-tip {
        margin-top: 10px;
        padding: 6px 16px;
        background: #248a52;
        color: #fff;
        border: none;
        border-radius: 6px;
    }

    /* ========== 媒体查询 小屏幕适配 ========== */
    @media (max-width: 768px) {
        .header { height: 70px; }
        .menu-toggle { display: block; }
        .header img { height: 70px; }
        .main { height: calc(100% - 70px); }
        .left-nav {
            width: 0;
            visibility: hidden;
        }
        .left-nav.open {
            width: 240px;
            visibility: visible;
        }
        .paper-wrap {
            width: 100%;
            padding: 0 6px;
            box-sizing: border-box;
        }
        .a4-page {
            width: 100%;
            height: auto;
            min-height: auto;
            box-shadow: none;
            padding: 10px 10px 20px 10px;
        }
        .a4-header-top {
            flex-direction: column;
            align-items: center;
        }
        .a4-page-title {
            font-size: 16pt;
            padding-bottom: 6px;
        }
        .a4-qrcode-box {
            display: none !important;
        }
        .a4-info-row {
            font-size: 10pt;
        }
        .tiku table {
            font-size: 12pt;
        }
        .tiku table tr td {
            width: 50%;
        }
        .input-number-wrap { display: none !important; }
        .mobile-select { display: block !important; }
        .a4-page-footer {
            position: static;
            margin-top: 10px;
        }
    }
    .mobile-select { display: none; }

    /* ========== 打印样式 ========== */
    @page {
        size: A4 portrait;
        margin: 0;
    }
    @media print {
        html, body {
            width: 100% !important;
            background: #fff !important;
            margin: 0 !important;
            padding: 0 !important;
            overflow: visible !important;
            -webkit-print-color-adjust: exact !important;
            print-color-adjust: exact !important;
        }
        .wechat-tip, .header, .left-nav, .menu-toggle,
        .control-bar, .dayin {
            display: none !important;
        }
        .main { display: block !important; }
        .main-content {
            overflow: visible !important;
            background: #fff !important;
            padding: 0 !important;
        }
        .paper-wrap {
            width: 210mm !important;
            margin: 0 !important;
            padding: 0 !important;
        }
        .a4-page {
            width: 210mm !important;
            height: 287mm !important;
            margin: 0 !important;
            padding: 8mm 12mm 4mm 12mm !important;
            box-shadow: none !important;
            page-break-after: always;
            break-after: page;
            overflow: hidden;
        }
        .a4-page:last-child {
            page-break-after: auto;
            break-after: auto;
        }
        .a4-header-top {
            display: flex !important;
            flex-direction: row !important;
            justify-content: space-between !important;
            align-items: flex-start !important;
        }
        .a4-page-title {
            flex: 1;
            text-align: center;
        }
        /* 【重点修复二维码打印丢失】 */
        .a4-qrcode-box {
            display:flex !important;
            visibility:visible !important;
            -webkit-print-color-adjust: exact !important;
            print-color-adjust: exact !important;
        }
        .a4-qrcode-box img {
            display:block !important;
            visibility:visible !important;
            width:22mm !important;
            height:22mm !important;
        }
        .tiku table { font-size: 13pt !important; }
        .blank-box { width: 36pt; height: 16pt; }
        .blank-circle { width: 16pt; height: 16pt; }
    }