 body {
  font-family: "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 20px;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 18px;
}

h3 > small {
  font-size: 14px;
}

body {
  padding: 20px 40px;
}

a {
  color: rgb(80, 100, 255);
}

a:hover {
  font-weight: normal;
  color: rgb(50, 70, 200);
}

a:focus {
  font-weight: normal;
}

h1.page-title {
  text-align: center;
}

header {
  float: none;
  position: relative;
  width: initial;
  margin: 0 auto;
}

footer {
  float: none;
  position: relative;
  width: initial;
  margin: 0 auto;
  bottom: 0;
}

section {
  float: none;
  width: initial;
  border: 1px solid #e5e5e5;
  border-width: 1px 0;
  padding: 20px 0;
  margin: 0 0 20px;
}

section p:last-child {
  margin-bottom: 0;
}

time.term {
  font-family: Georgia, 'Times New Roman', Times, serif;
}

.job-dept {
  margin: 0 0 .5em;
}

.aside-right {
  float: right;
  font-size: 14px;
  text-align: right;
}

.clear {
  clear: both;
}

.list-unstyled {
  list-style: none;
  padding-left: 0;
}

/* 1) 統一紙張與邊界 */
@page {
  size: A4;
  margin: 14mm 14mm 14mm 14mm; /* 固定 mm，避免 px/pt 捨入差異 */
}


@media print,
screen and (max-width: 960px) {
  header {
    padding-right: 0;
  }
}

@media print,
screen and (max-width: 720px) {}

@media print,
screen and (max-width: 480px) {
  body {
    padding: 15px;
  }
}

/* 2) 列印模式下的基礎字體與行高，用絕對值鎖定 */
@media print {
  html { print-color-adjust: exact; -webkit-print-color-adjust: exact; }

  /* 3) 分頁控制，降低孤行寡行與不合理拆頁 */
  p, li { orphans: 3; widows: 3; }
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
  ul, ol, li, .block { break-inside: avoid; page-break-inside: avoid; }
}

@media print {
  header {
    margin-bottom: 1em;
  }

  footer {
    display: none;
  }

  header img {
    width: 120px;
    height: auto;
    object-fit: contain;
  }

  header p {
    display: none;
  }

  section {
    border: 0;
    padding: 0;
  }

  .wrapper section .link {
    display: none;
  }

  .aside-right {
    display: none;
  }

  .print-hide {
    display: none;
  }

  #project, .project, #專案 {
    display: none;
  }
}