#medical-print-root {
  position: absolute;
  left: -100000px;
  top: 0;
  width: 210mm;
  color: #17211b;
  background: white;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}
.medical-print-sheet { box-sizing: border-box; width: 100%; min-height: 277mm; padding: 8mm; background: white; }
.medical-print-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12mm; padding-bottom: 6mm; border-bottom: 2px solid #1a6d46; }
.medical-print-header span,.prescription-print-caption span { color: #1a6d46; font-size: 8pt; font-weight: 800; letter-spacing: .12em; }
.medical-print-header h1 { margin: 2mm 0 1mm; font-size: 18pt; }
.medical-print-header p { margin: 0; color: #66736b; font-size: 9pt; }
.medical-print-header > div:last-child { text-align: right; }
.medical-print-header > div:last-child strong { display: block; font-size: 22pt; letter-spacing: .18em; }
.medical-print-header small { display: block; margin-top: 3mm; font-size: 9pt; }
.medical-print-meta { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #bac7bf; border-width: 0 0 1px 1px; }
.medical-print-meta div { min-height: 14mm; box-sizing: border-box; padding: 3mm; border: 1px solid #bac7bf; border-width: 1px 1px 0 0; }
.medical-print-meta span,.medical-print-footer span { display: block; color: #68756d; font-size: 8pt; }
.medical-print-meta strong { display: block; margin-top: 1.6mm; font-size: 10pt; }
.medical-record-content { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #bac7bf; border-width: 0 0 1px 1px; }
.medical-record-content > div { min-height: 29mm; padding: 4mm; border: 1px solid #bac7bf; border-width: 1px 1px 0 0; }
.medical-record-content h2,.medical-print-treatment h2 { margin: 0 0 3mm; color: #1a6d46; font-size: 10pt; }
.medical-record-content p { margin: 0; font-size: 10pt; line-height: 1.75; white-space: pre-wrap; }
.medical-print-treatment { padding-top: 5mm; }
.medical-print-treatment table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.medical-print-treatment th,.medical-print-treatment td { padding: 2.4mm; border: 1px solid #bac7bf; overflow-wrap: anywhere; font-size: 8.5pt; text-align: left; vertical-align: top; }
.medical-print-treatment th { color: #315b45; background: #f0f7f3; }
.print-empty-cell { padding: 9mm !important; color: #738078; text-align: center !important; }
.medical-print-footer { display: grid; grid-template-columns: 1fr 1.5fr; gap: 12mm; margin-top: 10mm; padding-top: 6mm; border-top: 1px solid #9dac9f; }
.medical-print-footer strong,.medical-print-footer small { display: block; margin-top: 3mm; font-size: 9pt; }
.medical-print-footer small { color: #68756d; }
.prescription-document-sheet { display: flex; flex-direction: column; align-items: center; }
.prescription-print-caption { display: flex; width: 100%; align-items: flex-start; justify-content: space-between; gap: 10mm; padding-bottom: 4mm; border-bottom: 1px solid #bdc9c1; }
.prescription-print-caption strong,.prescription-print-caption b,.prescription-print-caption small { display: block; }
.prescription-print-caption strong { margin-top: 2mm; font-size: 14pt; }
.prescription-print-caption > div:last-child { text-align: right; }
.prescription-print-caption b { font-size: 15pt; }.prescription-print-caption small { margin-top: 2mm; font-size: 9pt; }
.prescription-document-sheet img { display: block; width: 100%; max-height: 242mm; margin: 5mm auto 0; object-fit: contain; }
.prescription-document-sheet > footer { display: flex; width: 100%; justify-content: space-between; margin-top: auto; padding-top: 3mm; border-top: 1px solid #bdc9c1; color: #627068; font-size: 8pt; }

@page { size: A4 portrait; margin: 10mm; }
@media print {
  body.medical-printing > *:not(#medical-print-root) { display: none !important; }
  body.medical-printing #medical-print-root { position: static; display: block !important; width: auto; }
  .medical-print-sheet { min-height: auto; padding: 0; }
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
