body { background: #f5f5f5; padding: 2em 0; } /* 模拟 A4 纸比例 (1:1.414, 即 210mm:297mm) */ .preview-paper { background-color: white; width: 100%; height: 0; padding-bottom: 141.4%; /* A4 比例 */ position: relative; box-shadow: 0 0 10px rgba(0,0,0,0.1); overflow: hidden; } .preview-content { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 5%; } #qrcode { max-width: 100%; max-height: 100%; display: flex; align-items: center; justify-content: center; overflow: visible; /* 允许内容溢出 */ } #qrcode canvas { max-width: 100%; max-height: 100%; object-fit: contain; } /* 确保左右卡片内容区域高度一致 */ .ui.card .content { min-height: 400px; display: flex; padding: 1em !important; } /* 确保左右卡片高度一致 */ .ui.two.column.grid > .column { display: flex; } .ui.fluid.card { width: 100%; margin: 0; display: flex; flex-direction: column; } .ui.card > .content { flex-grow: 1; } /* 右侧卡片内容区适应 A4 比例 */ .preview-card .content { padding: 1em !important; display: flex; align-items: center; justify-content: center; } /* 输入区样式优化 */ .form-content { display: flex; flex-direction: column; padding-bottom: 1em !important; } .ui.form { display: flex; flex-direction: column; height: 100%; } .ui.form .field { margin-bottom: 1em; } .ui.form textarea { min-height: 80px; resize: vertical; } /* 自动拉伸中间区域 */ .ui.form .field:nth-child(2) textarea { flex-grow: 2; } /* 优化按钮间距与布局 */ .button-fields { margin-top: auto !important; margin-bottom: 0 !important; } .button-fields .field { padding: 0 !important; margin-bottom: 0.75em !important; /* 增加了按钮间间距 */ } .button-fields .field:last-child { margin-bottom: 0 !important; } /* 优化按钮容器 */ .button-container { margin-top: auto !important; padding: 0 !important; } /* 按钮间距调整 */ .ui.two.buttons { gap: 10px; /* 增加按钮之间的间距 */ display: flex; } /* 确保按钮宽度相等 */ .ui.two.buttons .button { margin: 0 !important; flex: 1; } /* 为打印按钮添加一点视觉区分 */ #printBtn { box-shadow: none !important; border: 1px solid #e0e1e2 !important; background-color: #f8f9fa !important; } #printBtn:hover { background-color: #e9ecef !important; } /* 打印样式 */ @media print { @page { size: A4 portrait; margin: 0; } html, body { width: 100%; height: 100%; margin: 0; padding: 0; background-color: #fff; } .ui.container, .ui.grid, .ui.basic.segment { display: none !important; } /* 显示打印容器 */ #print-container { display: block !important; position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 9999; background: white; } #print-container canvas { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 90%; max-height: 90%; height: auto !important; } } /* 打印专用容器(正常不显示) */ #print-container { display: none; }