        /* 基础样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            background-color: #f8fafc;
            font-family: 'Microsoft YaHei', Arial, sans-serif;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 1.5rem;
        }

        .head {
            text-align: center;
            margin-bottom: 1.5rem;
            border-bottom: 1px solid #e5e7eb;
            padding-bottom: 1rem;
        }

        .time {
            float: right;
            font-size: 0.8rem;
            background: #9E9E9E;
            color: #fff;
            border-radius: 10px;
            padding: 2px 10px 2px 10px;
            margin-top: -75px;
        }

        /* 卡片样式 */
        .card {
            background: #fff;
            border-radius: 0.75rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            padding: 2rem;
            position: relative;
            z-index: 1;
        }

        h1 {
            color: #1e40af;
            font-size: 1.875rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            text-align: center;
        }

        /* 可编辑标题样式 */
        .editable-title {
            width: 100%;
            border: none;
            background: transparent;
            font-size: 1.875rem;
            font-weight: 700;
            text-align: center;
            color: #1e40af;
            outline: none;
            padding: 0.5rem;
            border-radius: 0.375rem;
            transition: all 0.2s;
        }

        .editable-title:hover {
            background: #f8fafc;
        }

        .editable-title:focus {
            background: white;
            box-shadow: 0 0 0 2px #3b82f6;
        }

        /* 表格样式 */
        .table-container {
            overflow-x: auto;
            margin: 1.5rem 0;
            position: relative;
            z-index: 1;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 1rem;
            position: relative;
        }

        th,
        td {
            padding: 0.55rem;
            border-bottom: 1px solid #e5e7eb;
            position: relative;
        }

        th {
            background: #f3f4f6;
            color: #6b7280;
            font-size: 0.875rem;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        tr:nth-child(even) {
            background: #f8fafc;
        }

        input {
            width: 100%;
            padding: 6px;
            border: 1px solid #d1d5db;
            border-radius: 0.375rem;
            font-size: 1rem;
        }

        /* 客户信息横排样式 */
        .customer-info {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
            margin: 1.5rem 0;
        }

        .customer-field {
            display: flex;
            flex-direction: column;
        }

        .customer-label {
            font-size: 0.875rem;
            font-weight: 500;
            color: #6b7280;
            margin-bottom: 0.5rem;
        }

        /* 签名信息横排样式 */
        .signature-info {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
            margin: 1.5rem 0;
        }

        .signature-field {
            display: flex;
            flex-direction: column;
        }

        .signature-label {
            font-size: 0.875rem;
            font-weight: 500;
            color: #6b7280;
            margin-bottom: 0.5rem;
        }

        /* 可编辑备注样式 */
        .editable-note {
            color: #dc2626;
            margin: 1rem 0;
            padding: 0.75rem;
            border: 1px dashed #d1d5db;
            border-radius: 0.375rem;
            background: #fef2f2;
            cursor: pointer;
            transition: all 0.2s;
            min-height: 50px;
        }

        .editable-note:hover {
            background: #fecaca;
        }

        .editable-note:focus {
            outline: none;
            background: white;
            border: 1px solid #3b82f6;
            box-shadow: 0 0 0 2px #3b82f6;
        }

        /* 单位下拉选择样式 */
        .unit-container {
            position: relative;
            width: 100%;
        }

        .unit-input {
            width: 100%;
            padding: 6px;
            border: 1px solid #d1d5db;
            border-radius: 0.375rem;
            font-size: 1rem;
            background: white;
        }

        .unit-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            border: 1px solid #d1d5db;
            border-top: none;
            border-radius: 0 0 0.375rem 0.375rem;
            max-height: 200px;
            overflow-y: auto;
            z-index: 10000;
            display: none;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        }

        .unit-option {
            padding: 0.75rem 0.5rem;
            cursor: pointer;
            border-bottom: 1px solid #f1f1f1;
            font-size: 0.9rem;
            transition: background-color 0.2s;
        }

        .unit-option:hover {
            background-color: #3b82f6;
            color: white;
        }

        .unit-option.selected {
            background-color: #1e40af;
            color: white;
        }

        .unit-option:last-child {
            border-bottom: none;
        }

        button {
            padding: 0.625rem 1.25rem;
            border: none;
            border-radius: 0.375rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        button[type="button"] {
            background: #3b82f6;
            color: #fff;
        }

        button[type="button"]:hover {
            background: #2563eb;
        }

        button.delete-row {
            background: transparent;
            color: #ef4444;
            padding: 0;
            width: 2rem;
        }

        #add-row,
        #print-invoice {
            background: #4CAF50;
            color: #fff;
        }

        /* 打印和导出按钮容器样式 */
        .action-buttons {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 2rem 0 2rem 0;
            gap: 10px;
        }

        /* 打印按钮在左边 */
        .print-button {
            text-align: left;
            margin: 0;
        }

        /* 导出按钮在右边 */
        .export-section {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 10px;
        }

        /* 导出按钮样式 */
        .export-buttons {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
            margin: 0;
            flex-wrap: wrap;
        }

        .export-buttons button {
            background: #6c757d;
            color: white;
            padding: 10px 20px;
            border-radius: 5px;
            border: none;
            cursor: pointer;
            transition: background 0.3s;
        }

        .export-buttons button:hover {
            background: #5a6268;
        }

        /* 图片导出按钮样式 */
        .image-export-buttons {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
            margin: 0;
            flex-wrap: wrap;
        }

        .image-export-buttons button {
            background: #28a745;
            color: white;
            padding: 8px 16px;
            border-radius: 5px;
            border: none;
            cursor: pointer;
            transition: background 0.3s;
        }

        .image-export-buttons button:hover {
            background: #218838;
        }


        /* 说明文字样式 */
        .instruction {
            /* text-align: center; */
            color: #6b7280;
            font-size: 0.875rem;
            margin-bottom: 1rem;
            padding: 1.5rem;
            background: #fff;
            border-radius: 0.75rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            line-height: 30px;
        }

        .title {
            font-size: 18px;
            font-weight: 600;
            border-left: 5px solid #4caf50;
            padding-right: 10px;
            padding: 0 0 0 10px;
            margin-bottom: 10px;
        }

        .instruction ul {
            list-style: auto;
            padding-left: 15px;
        }

        /* 统计区域 */
        .stats {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: #f3f4f6;
            padding: 1rem;
            border-radius: 0.5rem;
            margin: 1.5rem 0;
        }

        .stats-item {
            display: flex;
            gap: 0.5rem;
        }

        .stats-value {
            color: #1e40af;
            font-weight: 600;
        }

        .money {
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            background: #fffbeb;
            padding: 1.25rem;
            margin: 1.5rem 0;
        }

        .company {
            text-align: center;
            margin-top: 1rem;
            font-size: 0.9rem;
            color: #6b7280;
        }

        /* 打印样式 */
        @media print {
            .no-print {
                display: none !important;
            }

            .instruction {
                display: none !important;
            }

            .editable-title {
                border: none !important;
                background: transparent !important;
                box-shadow: none !important;
            }

            .editable-note {
                border: none !important;
                background: transparent !important;
                box-shadow: none !important;
                color: #dc2626 !important;
            }

            input {
                border: none !important;
                background: transparent !important;
                box-shadow: none !important;
                padding: 0 !important;
            }

            .unit-dropdown {
                display: none !important;
            }

            input:focus {
                outline: none !important;
            }

            .card {
                box-shadow: none !important;
                border: 1px solid #ddd !important;
            }

            .table-container {
                overflow: visible !important;
            }

            button {
                display: none !important;
            }

            .export-buttons {
                display: none !important;
            }

            .image-export-buttons {
                display: none !important;
            }

            .delete-row {
                display: none !important;
            }

            body {
                background: white !important;
            }
        }

        /* 响应式调整 */
        @media (max-width: 768px) {
            .container {
                padding: 1rem;
            }

            .card {
                padding: 1.25rem;
            }

            .customer-info,
            .signature-info {
                grid-template-columns: 1fr;
                gap: 0.75rem;
            }

            .export-buttons {
                flex-direction: column;
            }

            .image-export-buttons {
                flex-direction: column;
            }

            .action-buttons {
                flex-direction: column;
                gap: 15px;
            }

            .print-button {
                text-align: center;
                width: 100%;
            }

            .export-section {
                align-items: center;
                width: 100%;
            }

            .export-buttons,
            .image-export-buttons {
                justify-content: center;
            }

            .unit-dropdown {
                position: fixed;
                top: auto !important;
                left: 10px !important;
                right: 10px !important;
                width: auto !important;
                z-index: 10001;
                max-height: 50vh;
            }
        }