@page {
  size: A4 portrait;
  margin: 10mm;
}

@media print {
  html,
  body {
    height: auto !important;
    overflow: visible !important;
    background: #ffffff !important;
    color: #000000 !important;
    display: block !important;
  }

  body > *:not(#print-root) {
    display: none !important;
  }

  #print-root {
    display: block !important;
  }

  .print-page {
    break-after: page;
    page-break-after: always;
    font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
    color: #000000;
  }

  .print-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .print-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6mm;
    border-bottom: 0.4mm solid #000;
    padding-bottom: 1.5mm;
  }

  .print-title {
    font-size: 5mm;
    font-weight: 700;
    line-height: 1.2;
  }

  .print-page-no {
    font-size: 3.4mm;
    white-space: nowrap;
  }

  .print-sub {
    margin: 2mm 0;
    font-size: 3.2mm;
    color: #333333;
  }

  .print-grid {
    display: grid;
    width: max-content;
    border: 0.4mm solid #000;
    box-sizing: content-box;
  }

  .print-cell {
    width: 5mm;
    height: 5mm;
    box-sizing: border-box;
    border: 0.1mm solid rgba(0, 0, 0, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4mm;
    line-height: 1;
    font-weight: 600;
    overflow: hidden;
  }

  .print-cell.bleed {
    opacity: 0.42;
  }

  .print-legend {
    margin-top: 3mm;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1mm 3mm;
    font-size: 2.8mm;
  }

  .pl-item {
    display: flex;
    align-items: center;
    gap: 1.2mm;
    overflow: hidden;
  }

  .pl-no {
    width: 4mm;
    text-align: right;
    font-weight: 700;
    flex: 0 0 auto;
  }

  .pl-swatch {
    width: 3.4mm;
    height: 3.4mm;
    border: 0.15mm solid #000;
    flex: 0 0 auto;
    display: inline-block;
  }

  .pl-code {
    font-weight: 600;
    flex: 0 0 auto;
  }

  .pl-name {
    color: #333333;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .pl-count {
    margin-left: auto;
    color: #333333;
    flex: 0 0 auto;
  }

  .print-foot {
    margin-top: 3mm;
    padding-top: 1.5mm;
    border-top: 0.2mm solid #999999;
    font-size: 2.8mm;
    color: #333333;
  }

  .cover-meta {
    margin: 3mm 0;
    font-size: 3.6mm;
    line-height: 1.8;
  }

  .cover-subtitle {
    margin: 4mm 0 2mm;
    font-size: 3.6mm;
    font-weight: 700;
    border-left: 1mm solid #000;
    padding-left: 2mm;
  }

  .cover-table {
    column-count: 2;
    column-gap: 8mm;
    font-size: 3mm;
  }

  .cover-row {
    display: flex;
    align-items: center;
    gap: 1.5mm;
    break-inside: avoid;
    page-break-inside: avoid;
    padding: 0.6mm 0;
  }

  .cover-row .pl-code {
    width: 11mm;
  }

  .cover-row .pl-name {
    flex: 1 1 auto;
  }

  .cover-row .pl-count {
    flex: 0 0 auto;
  }
}
