/* 健康报告打印样式 */

/* ---------- 屏幕预览 ---------- */
body[data-route="export-report"] #topbar,
body[data-route="export-report"] #tabbar,
body[data-route="export-report"] #rail {
  display: none !important;
}

body[data-route="export-report"] .main-panel {
  display: block;
  height: 100vh;
  overflow: auto;
}

body[data-route="export-report"] #screen {
  padding: 0;
  background: #f2f6f5;
}

.print-root {
  min-height: 100vh;
  padding: 24px 16px 40px;
}

.print-sheet {
  max-width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 0 0 1px #dbe5e2;
  padding: 20mm;
  color: #102420;
  font-size: 13px;
  line-height: 1.7;
}

.print-actions {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
  display: flex;
  gap: 8px;
}

.print-actions .btn {
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16,36,32,.12);
}

.print-actions .btn-primary {
  background: #0b7a62;
  color: #fff;
}

.print-actions .btn-ghost {
  background: #fff;
  color: #34504a;
  border: 1px solid #d7e2df;
}

/* ---------- 报告内容排版 ---------- */

.print-sheet h1 {
  font-size: 28px;
  margin: 0 0 8px;
  text-align: center;
  letter-spacing: 1px;
}

.print-sheet .print-subtitle {
  text-align: center;
  color: #6f867f;
  font-size: 13px;
  margin-bottom: 32px;
}

.print-section {
  margin-bottom: 26px;
}

.print-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #0b7a62;
  border-bottom: 2px solid #e6edeb;
  padding-bottom: 6px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.print-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220mm;
  text-align: center;
}

.print-cover .brand-mark {
  width: 72px;
  height: 72px;
  background: #0b7a62;
  color: #fff;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 24px;
}

.print-cover h2 {
  font-size: 32px;
  margin: 0 0 12px;
}

.print-cover .meta {
  color: #6f867f;
  font-size: 14px;
  margin-bottom: 36px;
}

.print-cover .info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 32px;
  text-align: left;
  margin-bottom: 32px;
  width: 100%;
  max-width: 340px;
}

.print-cover .info-grid div {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.print-cover .info-grid span { color: #6f867f; }

.print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 8px;
}

.print-table th,
.print-table td {
  border: 1px solid #e6edeb;
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}

.print-table th {
  background: #f4f9f7;
  font-weight: 600;
  color: #34504a;
}

.print-table td { color: #102420; }

.print-kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 16px;
  font-size: 13px;
}

.print-kv dt { color: #6f867f; }
.print-kv dd { margin: 0; font-weight: 500; }

.abnormal-card {
  border: 1px solid #e6edeb;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.abnormal-card .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.abnormal-card .name {
  font-size: 15px;
  font-weight: 700;
}

.abnormal-card .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.abnormal-card .badge-red { background: #fdeeee; color: #c43d3d; }
.abnormal-card .badge-amber { background: #fdf4e3; color: #a36a00; }
.abnormal-card .badge-green { background: #e9f7f2; color: #0b7a62; }

.abnormal-card .value-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
}

.abnormal-card .value-row .big {
  font-size: 20px;
  font-weight: 700;
}

.abnormal-card .value-row .ref { color: #6f867f; }

.print-disclaimer {
  margin-top: 32px;
  padding-top: 14px;
  border-top: 1px solid #e6edeb;
  font-size: 11px;
  color: #93a49f;
  line-height: 1.6;
}

/* ---------- 打印模式 ---------- */
@media print {
  @page { size: A4; margin: 16mm; }

  body * { visibility: hidden; }
  .print-root, .print-root * { visibility: visible; }

  body { background: #fff; }

  .print-root {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0;
    background: #fff;
  }

  .print-sheet {
    box-shadow: none;
    max-width: none;
    padding: 0;
    margin: 0;
    border-radius: 0;
    min-height: auto;
  }

  .print-actions { display: none !important; }

  .print-cover { min-height: auto; padding-top: 30mm; }

  .page-break { page-break-before: always; }
  .no-break { page-break-inside: avoid; }

  .print-section { page-break-inside: avoid; }
  .abnormal-card { page-break-inside: avoid; }

  svg { max-width: 100%; height: auto; }
}
