.history-page .history-layout {
  max-width: var(--content);
  margin-inline: auto;
  padding: 64px 24px 80px;
}

.history-page .history-start {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--gold);
  color: var(--blue);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.history-page .history-opening__aside {
  padding: 8px 0 8px 28px;
  border-left: 2px solid var(--gold);
}

.history-page .history-opening__aside p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 18px;
}

.history-page .history-eras {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-page .history-eras > li {
  display: flex;
  min-width: 0;
}

.history-page .history-era {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 320px;
  padding: 30px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(224, 241, 248, 0.94));
  color: var(--ink);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.history-page .history-era:hover {
  border-color: var(--gold);
  box-shadow: 0 12px 28px rgba(6, 58, 91, 0.1);
}

.history-page .history-era--first {
  border-color: #8bb8cf;
  border-top-color: var(--gold);
  background: linear-gradient(135deg, #c1dae8 0%, #c9e0ec 60%, #bdd6e5 100%);
  color: var(--blue);
}

.history-page .history-era__top {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 30px;
  margin-bottom: 30px;
  font-size: 13px;
  line-height: 1.4;
}

.history-page .history-era__number {
  color: #8a6429;
  font-size: 23px;
  line-height: 1;
}

.history-page .history-era__title {
  color: var(--blue);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.history-page .history-era--first .history-era__title {
  color: var(--blue);
}

.history-page .history-era__centuries {
  display: block;
  font-size: clamp(32px, 3.3vw, 56px);
  line-height: 1.08;
  white-space: nowrap;
}

.history-page .history-era--first .history-era__centuries {
  font-size: clamp(36px, 4vw, 68px);
}

.history-page .history-era__unit {
  display: block;
  margin-top: 6px;
  font-size: 25px;
  letter-spacing: 0;
}

.history-page .history-era__plain {
  margin-top: 14px;
  font-size: 15px;
  opacity: 0.8;
}

.history-page .history-era__summary {
  margin: 24px 0 30px;
  font-size: 18px;
  line-height: 1.5;
}

.history-page .history-era__open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.history-page .history-era--first .history-era__open {
  border-color: rgba(6, 58, 91, 0.2);
}

.history-page .history-era__open > span {
  color: var(--gold);
  font-size: 26px;
  font-weight: 400;
}

.history-page .history-continuity {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr);
  gap: 40px;
  margin-top: 42px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.history-page .history-continuity h2 {
  font-size: 27px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.history-page .history-continuity p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.history-page .history-epoch-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 42px;
}

.history-page .history-epoch-nav a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--blue);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.history-page .history-epoch-nav a[aria-current="page"] {
  border-color: #8bb8cf;
  background: linear-gradient(110deg, #c1dae8, #c9e0ec);
  color: var(--blue);
  box-shadow: inset 0 -3px 0 var(--gold);
}

.history-page .history-epoch-nav small {
  font-size: 13px;
  font-weight: 400;
}

.history-page .history-reading-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.history-page .history-toc {
  padding-top: 8px;
  position: sticky;
  top: 120px;
}

.history-page .history-toc h2 {
  margin-bottom: 16px;
  font-size: 23px;
  line-height: 1.3;
}

.history-page .history-toc p {
  color: var(--ink-soft);
  font-size: 15px;
}

.history-page .history-toc__details {
  border-block: 1px solid var(--line);
}

.history-page .history-toc__details summary {
  padding: 16px 0;
  color: var(--blue);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.history-page .history-toc__list {
  max-height: min(65vh, 720px);
  margin: 0 0 16px;
  padding: 0 10px 0 0;
  overflow-y: auto;
  list-style: none;
}

.history-page .history-toc__list li + li {
  margin-top: 12px;
}

.history-page .history-toc__list a {
  display: block;
  font-size: 16px;
  line-height: 1.45;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.history-page .history-reading {
  min-width: 0;
  padding: 36px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius-md);
  background: linear-gradient(125deg, #ffffff 0%, #fbfdfe 64%, #f0f7fb 100%);
  scroll-margin-top: 140px;
}

.history-page .history-reading h2 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.history-page .history-reading p {
  max-width: none;
  font-size: clamp(20px, 1.3vw, 25px);
  line-height: 1.65;
  text-align: justify;
  text-justify: inter-word;
  hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
}

.history-page #chapter-01 > p:first-of-type {
  color: var(--blue);
  font-size: clamp(22px, 1.5vw, 28px);
  line-height: 1.55;
}

.history-page .history-chapter,
.history-page .history-sources {
  max-width: none;
  margin-top: 36px;
  scroll-margin-top: 140px;
}

.history-page .history-chapter + .history-chapter,
.history-page .history-sources {
  padding-top: 30px;
  border-top: 1px solid var(--line);
  border-image: linear-gradient(90deg, rgba(196, 151, 70, 0.7), rgba(97, 187, 228, 0.3), transparent) 1;
}

.history-page .history-chapter h3 {
  display: grid;
  grid-template-columns: minmax(3ch, max-content) minmax(0, 1fr);
  column-gap: 14px;
}

.history-page .history-chapter__number {
  color: #8a6429;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.history-page .history-chapter h3,
.history-page .history-sources h3 {
  font-size: clamp(24px, 2.1vw, 34px);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.history-page .history-references {
  padding-left: 22px;
  font-size: 20px;
  line-height: 1.7;
}

.history-page .history-references li + li {
  margin-top: 14px;
}

.history-page .history-author {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--gold);
  font-style: italic;
}

.history-page .history-author p,
.history-page .history-author address {
  margin: 0;
  font-size: 20px;
  line-height: 1.6;
}

.history-page .history-author address {
  text-align: right;
}

.history-page .history-future {
  max-width: 960px;
}

.history-page .history-layout a:focus-visible {
  outline: 3px solid var(--blue-soft);
  outline-offset: 5px;
}

@media (max-width: 960px) {
  .history-page .history-opening,
  .history-page .history-continuity {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .history-page .history-opening__aside {
    max-width: 70ch;
  }

  .history-page .history-eras {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-page .history-eras > li:first-child {
    grid-column: 1 / -1;
  }

  .history-page .history-era {
    min-height: 340px;
  }

  .history-page .history-reading-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .history-page .history-toc {
    position: static;
  }

  .history-page .history-toc__list {
    max-height: 280px;
  }
}

@media (max-width: 600px) {
  .history-page .history-layout {
    padding: 36px 16px 48px;
  }

  .history-page .history-opening {
    margin-bottom: 30px;
  }

  .history-page .history-opening__aside {
    padding-left: 18px;
  }

  .history-page .history-eras,
  .history-page .history-epoch-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .history-page .history-era {
    min-height: 320px;
    padding: 26px 22px;
  }

  .history-page .history-era__centuries,
  .history-page .history-era--first .history-era__centuries {
    font-size: clamp(36px, 8vw, 48px);
  }

  .history-page .history-epoch-nav a {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .history-page .history-reading {
    padding: 24px 20px;
    scroll-margin-top: 240px;
  }

  .history-page .history-chapter,
  .history-page .history-sources {
    scroll-margin-top: 240px;
  }

  .history-page .history-reading p {
    font-size: 20px;
    text-align: start;
  }

  .history-page .history-author {
    flex-direction: column;
  }

  .history-page .history-author address {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .history-page .history-era {
    transition: none;
  }
}
