:root {
  --ink: #20252b;
  --muted: #68717a;
  --line: #d8dde1;
  --soft: #f5f7f8;
  --accent: #135f7a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family:
    "BIZ UDPGothic", "Yu Gothic", "YuGothic", "Hiragino Kaku Gothic ProN",
    Meiryo, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  width: min(1040px, calc(100% - 48px));
  margin: 0 auto;
  padding: 64px 0 56px;
}

.site-nav {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 12px rgba(25, 37, 45, 0.06);
}

.nav-inner {
  display: flex;
  width: min(1040px, calc(100% - 48px));
  min-height: 58px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
}

.nav-breadcrumb {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.book-index-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.book-index-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.book-index-link:focus-visible {
  border-radius: 2px;
  outline: 3px solid rgba(19, 95, 122, 0.25);
  outline-offset: 3px;
}

.breadcrumb-separator {
  color: var(--muted);
  font-weight: 400;
}

.nav-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.nav-menu {
  position: relative;
}

.nav-menu button {
  display: flex;
  min-width: 112px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
}

.nav-menu button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.nav-menu button:focus-visible {
  outline: 3px solid rgba(19, 95, 122, 0.25);
  outline-offset: 2px;
}

.hamburger {
  display: flex;
  width: 18px;
  flex-direction: column;
  gap: 4px;
}

.hamburger i {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease;
}

.nav-menu.is-open .hamburger i:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-menu.is-open .hamburger i:nth-child(2) {
  opacity: 0;
}
.nav-menu.is-open .hamburger i:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-links {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 270px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 14px 34px rgba(25, 37, 45, 0.16);
}

.nav-links a {
  display: block;
  padding: 11px 13px;
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: var(--soft);
  color: var(--accent);
}

.book-introduction {
  padding-bottom: 52px;
  border-bottom: 3px solid var(--accent);
}

.book-grid {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: clamp(36px, 6vw, 72px);
  align-items: start;
}

.cover-wrap {
  padding: 1px;
  background: #fff;
  box-shadow:
    0 18px 42px rgba(25, 37, 45, 0.16),
    0 2px 8px rgba(25, 37, 45, 0.1);
}

.book-cover {
  display: block;
  width: 100%;
  height: auto;
}

.series-name {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 3.6vw, 39px);
  line-height: 1.5;
  letter-spacing: 0.04em;
}

h1 span {
  display: block;
}

.edition {
  margin: 10px 0 6px;
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.authors {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13px;
}

.summary {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.95;
}

.book-meta {
  margin: 25px 0 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.book-meta div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
  line-height: 1.7;
}

.book-meta dt {
  color: var(--muted);
  font-weight: 700;
}

.book-meta dd {
  margin: 0;
}

.book-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.booth-link,
.errata-link {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.booth-link {
  background: var(--accent);
  color: #fff;
}

.errata-link {
  color: var(--accent);
}

.booth-link:hover,
.booth-link:focus-visible {
  background: #0d4b62;
  border-color: #0d4b62;
}

.errata-link:hover,
.errata-link:focus-visible {
  background: var(--accent);
  color: #fff;
}

.booth-link:focus-visible,
.errata-link:focus-visible {
  outline: 3px solid rgba(19, 95, 122, 0.25);
  outline-offset: 3px;
}

.book-guide {
  margin-top: 54px;
}

.guide-section + .guide-section {
  margin-top: 48px;
}

.guide-section {
  scroll-margin-top: 88px;
}

.guide-section h2 {
  margin-bottom: 18px;
}

.reader-list {
  margin: 0;
  padding: 0 0 0 1.5em;
  list-style: disc;
}

.reader-list li {
  padding: 4px 0 4px 3px;
  line-height: 1.75;
}

.reader-list li::marker {
  color: var(--accent);
}

.contents-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin: 0;
  padding: 1px;
  background: var(--line);
  list-style: none;
}

.contents-list li {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  min-height: 48px;
  padding: 10px 16px;
  background: #fff;
}

.contents-list span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.contents-list strong {
  font-size: 14px;
  line-height: 1.55;
}

.contents-list .feature {
  background: var(--soft);
}

.software-card {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding: 24px;
  border: 1px solid var(--line);
}

.software-card h3 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 18px;
}

.software-card p {
  max-width: 670px;
  margin: 0;
  line-height: 1.9;
}

.software-card .software-note {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.software-links {
  display: grid;
  width: min(100%, 290px);
  flex: 0 0 290px;
  gap: 10px;
}

.software-links a,
.series-books a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.software-links a {
  display: flex;
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid var(--accent);
  flex-direction: column;
  justify-content: center;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.software-links a:hover,
.software-links a:focus-visible {
  background: #edf5f7;
}

.software-links .software-primary {
  background: var(--accent);
  color: #fff;
}

.software-links .software-primary:hover,
.software-links .software-primary:focus-visible {
  background: #0d4b62;
}

.software-links span {
  font-size: 13px;
}

.software-links small {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 500;
  opacity: 0.82;
}

.series-books {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.series-books a {
  display: flex;
  flex-direction: column;
  min-height: 154px;
  padding: 22px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.series-books a:hover,
.series-books a:focus-visible {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.series-books a:focus-visible,
.software-links a:focus-visible {
  outline: 3px solid rgba(19, 95, 122, 0.25);
  outline-offset: 3px;
}

.series-books span {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.series-books strong {
  font-size: 14px;
  line-height: 1.75;
}

.series-books small {
  margin-top: auto;
  padding-top: 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.notes {
  scroll-margin-top: 88px;
  margin-top: 48px;
  padding: 22px 24px;
  background: var(--soft);
}

.notes h2 {
  margin-bottom: 8px;
  padding: 0;
  border: 0;
  font-size: 15px;
}

.notes ul {
  margin: 0;
  padding-left: 1.5em;
  color: #4d5861;
  font-size: 12px;
  line-height: 1.9;
}

.updated {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.intro {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.9;
}

.errata-heading {
  scroll-margin-top: 24px;
  margin-top: 56px;
}

.errata-heading h2 {
  padding-left: 0;
  border-left: 0;
  font-size: 30px;
}

.errata-section {
  margin-top: 44px;
}

h2,
.errata-section h3 {
  margin: 0 0 12px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
  font-size: 23px;
  line-height: 1.5;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 13px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.75;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  background: var(--soft);
  font-weight: 700;
}

th:last-child,
td:last-child {
  border-right: 0;
}

tr:last-child td {
  border-bottom: 0;
}

.page-column {
  width: 76px;
}
.location-column {
  width: 23%;
}
.page-cell {
  text-align: center;
}
.location-cell {
  color: #4d5861;
}

footer {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 680px) {
  .nav-inner {
    width: min(100% - 28px, 600px);
  }
  .nav-breadcrumb {
    gap: 0;
  }
  .book-index-link::before {
    content: "←";
    margin-right: 7px;
  }
  .breadcrumb-separator,
  .nav-breadcrumb .nav-title {
    display: none;
  }
  .nav-links {
    position: fixed;
    top: 58px;
    right: 14px;
    left: 14px;
    width: auto;
  }
  main {
    width: min(100% - 28px, 600px);
    padding-top: 36px;
  }

  .book-introduction {
    padding-bottom: 40px;
  }
  .book-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .cover-wrap {
    width: min(82vw, 360px);
    margin: 0 auto;
  }
  h1 span {
    display: inline;
  }
  .authors {
    margin-bottom: 24px;
  }
  .summary {
    font-size: 14px;
    line-height: 1.9;
  }
  .book-guide {
    margin-top: 42px;
  }
  .guide-section + .guide-section {
    margin-top: 40px;
  }
  .series-books {
    grid-template-columns: 1fr;
  }
  .contents-list li {
    min-height: 0;
    padding: 9px 12px;
  }
  .software-card {
    flex-direction: column;
    gap: 18px;
    padding: 20px;
  }
  .software-links {
    width: 100%;
    flex-basis: auto;
  }
  .notes {
    margin-top: 38px;
    padding: 18px;
  }
  .errata-heading {
    margin-top: 44px;
  }
  .errata-section {
    margin-top: 38px;
  }
  h2,
  .errata-section h3 {
    font-size: 20px;
  }
  .errata-heading h2 {
    font-size: 26px;
  }

  .table-wrap {
    border: 0;
    overflow: visible;
  }
  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }
  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  tr {
    margin-bottom: 12px;
    border: 1px solid var(--line);
  }
  td {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 10px;
    padding: 11px 12px;
    border-right: 0;
    text-align: left;
  }
  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }
  .page-cell {
    text-align: left;
  }
}

@media print {
  .site-nav {
    display: none;
  }
  main {
    width: 100%;
    padding: 10mm 12mm;
  }
  .book-links {
    display: none;
  }
  .book-grid {
    grid-template-columns: 52mm 1fr;
    gap: 10mm;
  }
  .guide-section,
  .series-books a,
  .software-card {
    break-inside: avoid;
  }
  .errata-section {
    break-inside: avoid;
  }
  .table-wrap {
    overflow: visible;
  }
}
