.candidate-print-shell {
  width: min(1760px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.candidate-print-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 18px;
}

.candidate-print-topbar h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
}

.candidate-print-topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.candidate-print-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.candidate-print-note {
  display: flex;
  gap: 10px;
  margin: 14px 0;
  border-left: 4px solid var(--accent);
  background: #f7fbf9;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 800;
}

.candidate-print-note strong {
  color: var(--ink);
}

.candidate-print-table-wrap {
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.candidate-print-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.candidate-print-table th,
.candidate-print-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid #eee6da;
  padding: 9px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.55;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.candidate-print-table th {
  background: #f5efe4;
  color: #364044;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
  white-space: nowrap;
}

.candidate-print-table td strong,
.candidate-print-table td span {
  display: block;
}

.candidate-print-table td span {
  color: var(--muted);
}

.candidate-print-table th:nth-child(1),
.candidate-print-table td:nth-child(1) {
  width: 4.5%;
  text-align: center;
}

.candidate-print-table th:nth-child(2),
.candidate-print-table td:nth-child(2) {
  width: 20%;
}

.candidate-print-table th:nth-child(3),
.candidate-print-table td:nth-child(3) {
  width: 7%;
}

.candidate-print-table th:nth-child(4),
.candidate-print-table td:nth-child(4) {
  width: 7%;
}

.candidate-print-table th:nth-child(5),
.candidate-print-table td:nth-child(5) {
  width: 10%;
}

.candidate-print-table th:nth-child(6),
.candidate-print-table td:nth-child(6) {
  width: 12%;
}

.candidate-print-table th:nth-child(7),
.candidate-print-table td:nth-child(7) {
  width: 16%;
}

.candidate-print-table th:nth-child(8),
.candidate-print-table td:nth-child(8) {
  width: 16%;
}

.candidate-print-table th:nth-child(9),
.candidate-print-table td:nth-child(9) {
  width: 7.5%;
}

.candidate-year-counts,
.candidate-history-list {
  display: grid;
  gap: 4px;
}

.candidate-year-counts span,
.candidate-history-list span {
  border-left: 2px solid var(--line);
  padding-left: 6px;
}

.candidate-year-counts b,
.candidate-history-list b {
  display: inline;
  margin-right: 6px;
  color: var(--ink);
}

.candidate-trend {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  border-radius: 4px;
  background: #f2f2ee;
  color: var(--muted);
  padding: 2px 6px;
  font-weight: 900;
}

.candidate-trend.is-highlight {
  background: #fff0d6;
  color: #9a5a00;
}

.candidate-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.candidate-missing-row td {
  background: #fff8f0;
}

.candidate-empty {
  padding: 28px !important;
  color: var(--muted) !important;
  font-weight: 900;
  text-align: center;
}

@media screen and (max-width: 900px) {
  .candidate-print-shell {
    padding: 12px;
  }

  .candidate-print-topbar {
    flex-direction: column;
  }

  .candidate-print-actions {
    justify-content: flex-start;
  }

  .candidate-print-table-wrap {
    border: 0;
    background: transparent;
    overflow-x: hidden;
  }

  .candidate-print-table,
  .candidate-print-table tbody,
  .candidate-print-table tr,
  .candidate-print-table td {
    display: block;
    width: 100%;
  }

  .candidate-print-table {
    border-collapse: separate;
    border-spacing: 0;
  }

  .candidate-print-table thead {
    display: none;
  }

  .candidate-print-table tr {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .candidate-print-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    border-bottom: 1px solid #eee6da;
    padding: 10px 12px;
  }

  .candidate-print-table td::before {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
  }

  .candidate-print-table td:nth-child(1)::before {
    content: "序号";
  }

  .candidate-print-table td:nth-child(2)::before {
    content: "院校/专业";
  }

  .candidate-print-table td:nth-child(3)::before {
    content: "省市";
  }

  .candidate-print-table td:nth-child(4)::before {
    content: "选科";
  }

  .candidate-print-table td:nth-child(5)::before {
    content: "计划";
  }

  .candidate-print-table td:nth-child(6)::before {
    content: "人数";
  }

  .candidate-print-table td:nth-child(7)::before {
    content: "历年";
  }

  .candidate-print-table td:nth-child(8)::before {
    content: "限制";
  }

  .candidate-print-table td:nth-child(9)::before {
    content: "操作";
  }
}

@page {
  size: A4 landscape;
  margin: 8mm;
}

@media print {
  body {
    background: #fff;
  }

  .candidate-print-shell {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .candidate-print-actions,
  .candidate-print-note,
  .screen-only {
    display: none !important;
  }

  .candidate-print-topbar {
    display: block;
    border: 0;
    border-radius: 0;
    background: #fff;
    padding: 0 0 4mm;
  }

  .candidate-print-topbar h1 {
    font-size: 14pt;
  }

  .candidate-print-topbar p {
    margin-top: 2mm;
    font-size: 8.5pt;
  }

  .candidate-print-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .candidate-print-table {
    display: table;
    min-width: 0;
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }

  .candidate-print-table thead {
    display: table-header-group;
  }

  .candidate-print-table tbody {
    display: table-row-group;
  }

  .candidate-print-table tr {
    display: table-row;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .candidate-print-table th,
  .candidate-print-table td {
    display: table-cell;
    border: 0.6pt solid #777;
    padding: 2.5pt 3pt;
    color: #111;
    font-size: 8.7pt;
    line-height: 1.28;
  }

  .candidate-print-table td::before {
    display: none !important;
    content: "" !important;
  }

  .candidate-print-table th {
    background: #eee;
    font-size: 8.8pt;
  }

  .candidate-print-table th:nth-child(1),
  .candidate-print-table td:nth-child(1) {
    width: 5%;
  }

  .candidate-print-table th:nth-child(2),
  .candidate-print-table td:nth-child(2) {
    width: 20%;
  }

  .candidate-print-table th:nth-child(3),
  .candidate-print-table td:nth-child(3) {
    width: 8%;
  }

  .candidate-print-table th:nth-child(4),
  .candidate-print-table td:nth-child(4) {
    width: 8%;
  }

  .candidate-print-table th:nth-child(5),
  .candidate-print-table td:nth-child(5) {
    width: 11%;
  }

  .candidate-print-table th:nth-child(6),
  .candidate-print-table td:nth-child(6) {
    width: 13%;
  }

  .candidate-print-table th:nth-child(7),
  .candidate-print-table td:nth-child(7) {
    width: 17%;
  }

  .candidate-print-table th:nth-child(8),
  .candidate-print-table td:nth-child(8) {
    width: 18%;
  }

  .candidate-year-counts,
  .candidate-history-list {
    gap: 1pt;
  }

  .candidate-year-counts span,
  .candidate-history-list span {
    border-left: 0;
    padding-left: 0;
  }

  .candidate-trend {
    margin-top: 2pt;
    padding: 0;
    background: transparent;
    color: #111;
  }
}
