:root {
  --red: #8C1F28;
  --gold: #D4AF37;
  --deep-blue: #1F3A5F;
  --white: #FFFFFF;
  --cream: #F5F0E6;
  --ink: #2B2D42;
  --lapis: #B8860B;
  --alert: #E63946;
  --page-bg: var(--cream);
  --surface: #FFFDF8;
  --text: var(--ink);
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Roboto Mono", "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  --container: 1240px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --transition: 180ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--deep-blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--red);
}

main {
  display: block;
  min-height: 60vh;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.section {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.page-head {
  margin-bottom: 1.5rem;
  padding: calc(var(--gutter) + 1rem) 0 1rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.6);
}

.breadcrumbs {
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--lapis);
}

.breadcrumbs a {
  color: var(--deep-blue);
}

.breadcrumbs a:hover {
  color: var(--red);
}

.section-title {
  margin: 0 0 1.5rem;
  padding-left: 0.75rem;
  border-left: 4px solid var(--red);
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
}

.lead {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--ink);
  max-width: 62ch;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border: 1px solid var(--red);
  background: var(--red);
  color: var(--cream);
  font-family: var(--font-sans);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--deep-blue);
  border-color: var(--deep-blue);
  color: var(--cream);
}

.btn--outline {
  background: transparent;
  color: var(--red);
}

.btn--outline:hover {
  background: var(--red);
  color: var(--cream);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(212, 175, 55, 0.45);
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(43, 45, 66, 0.06);
}

.card:hover {
  box-shadow: 0 8px 20px rgba(43, 45, 66, 0.1);
}

.card__title {
  margin: 0.5rem 0;
  font-family: var(--font-serif);
  font-size: 1.2rem;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--gold);
  color: var(--deep-blue);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.badge {
  display: inline-flex;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--red);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.note {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--gold);
  background: var(--cream);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(212, 175, 55, 0.6);
  background: var(--surface);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap th,
.table-wrap td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--cream);
  text-align: left;
  white-space: nowrap;
}

.table-wrap th {
  background: var(--deep-blue);
  color: var(--cream);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.85rem;
}

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

.index-list {
  display: grid;
  gap: 0.45rem;
}

.index-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(212, 175, 55, 0.4);
  text-decoration: none;
}

.index-list a::after {
  content: "↗";
  color: var(--red);
}

.media-frame {
  position: relative;
  background: linear-gradient(135deg, var(--cream), var(--surface));
  border: 1px solid var(--gold);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0.5rem;
  border: 1px solid rgba(212, 175, 55, 0.5);
  pointer-events: none;
}

.media-frame--landscape {
  aspect-ratio: 16 / 9;
}

.media-frame--portrait {
  aspect-ratio: 3 / 4;
}

.media-frame--square {
  aspect-ratio: 1;
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.8rem 1.2rem;
  border-radius: 0 0 0.3rem 0.3rem;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--gold));
  pointer-events: none;
}

.site-header {
  position: relative;
  border-top: 4px solid var(--red);
  border-bottom: 1px solid var(--gold);
  background: var(--deep-blue);
  color: var(--cream);
}

.site-header::after {
  content: "";
  display: block;
  height: 8px;
  background: repeating-linear-gradient(90deg, var(--red) 0 14px, var(--gold) 14px 28px, var(--cream) 28px 42px, var(--lapis) 42px 56px, var(--deep-blue) 56px 70px);
}

.site-header__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: 1rem var(--gutter) 0;
}

.site-header__bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--cream);
  text-decoration: none;
  line-height: 1;
}

.brand:hover,
.brand--footer:hover {
  color: var(--gold);
}

.brand__mark {
  position: relative;
  display: inline-block;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--gold);
  background: repeating-linear-gradient(90deg, var(--red) 0 3px, var(--gold) 3px 6px, var(--deep-blue) 6px 9px, var(--cream) 9px 12px);
  transform: rotate(45deg);
  overflow: hidden;
}

.brand__mark-line {
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(245, 240, 230, 0.55);
}

.brand__mark-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--gold);
  transform: translate(-50%, -50%);
}

.brand__name {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  color: var(--gold);
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.header-search {
  position: relative;
  max-width: 380px;
  justify-self: center;
}

.header-search__icon {
  position: absolute;
  top: 50%;
  left: 0.6rem;
  color: var(--gold);
  font-size: 1.1rem;
  line-height: 1;
  transform: translateY(-50%);
  pointer-events: none;
}

.header-search__input {
  width: 100%;
  padding: 0.55rem 0.8rem 0.55rem 2rem;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: rgba(255, 255, 255, 0.1);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.header-search__input::placeholder {
  color: rgba(245, 240, 230, 0.55);
}

.header-search__input:focus {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.15);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-toggle:hover {
  background: rgba(212, 175, 55, 0.15);
}

.nav-toggle__line {
  display: block;
  width: 1rem;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 -5px 0 currentColor;
}

.site-nav {
  display: block;
  max-height: 0;
  overflow: hidden;
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(0, 0, 0, 0.15);
  transition: max-height 0.25s ease;
}

.site-nav[data-open] {
  max-height: 24rem;
}

.nav-list {
  display: grid;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
}

.nav-item {
  border-bottom: 1px solid rgba(245, 240, 230, 0.12);
}

.nav-item:last-child {
  border-bottom: 0;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.85rem 0.25rem;
  color: var(--cream);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-link:hover {
  color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}

.nav-link[aria-current="page"] {
  background: var(--red);
  color: var(--gold);
}

.nav-link[aria-current="page"] .nav-index {
  color: var(--cream);
}

.nav-index {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.scroll-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--gold);
  background: var(--deep-blue);
  color: var(--gold);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.scroll-top:hover {
  background: var(--red);
  color: var(--cream);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--lapis);
  background: transparent;
  color: var(--deep-blue);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.filter-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.filter-btn[aria-pressed="true"],
.filter-btn.is-active {
  border-color: var(--red);
  background: var(--red);
  color: var(--cream);
}

.site-footer {
  position: relative;
  background: var(--deep-blue);
  color: var(--cream);
}

.site-footer::before {
  content: "";
  display: block;
  height: 8px;
  background: repeating-linear-gradient(90deg, var(--red) 0 14px, var(--gold) 14px 28px, var(--cream) 28px 42px, var(--lapis) 42px 56px, var(--deep-blue) 56px 70px);
}

.site-footer__inner {
  display: grid;
  gap: 2rem;
  max-width: var(--container);
  margin: 0 auto;
  padding: 3rem var(--gutter) 2rem;
}

.site-footer__about {
  max-width: 55ch;
}

.brand--footer .brand__name {
  color: var(--cream);
  font-size: 1.3rem;
}

.brand--footer .brand__sub {
  writing-mode: horizontal-tb;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
}

.site-footer__desc {
  color: rgba(245, 240, 230, 0.85);
}

.site-footer__contact {
  margin-top: 1rem;
  font-style: normal;
  line-height: 1.8;
  color: rgba(245, 240, 230, 0.8);
}

.site-footer__nav {
  min-width: 0;
}

.site-footer__title {
  margin: 0 0 1rem;
  padding-left: 0.6rem;
  border-left: 3px solid var(--red);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.footer-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-list a {
  display: inline-block;
  padding: 0.15rem 0;
  border-bottom: 1px solid transparent;
  color: var(--cream);
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition);
}

.footer-list a:hover {
  border-bottom-color: var(--gold);
  color: var(--gold);
}

.site-footer__bottom {
  border-top: 2px solid rgba(212, 175, 55, 0.5);
  background: rgba(0, 0, 0, 0.12);
}

.site-footer__bottom-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  justify-content: center;
  max-width: var(--container);
  margin: 0 auto;
  padding: 1rem var(--gutter);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: rgba(245, 240, 230, 0.7);
}

.site-footer__copyright,
.site-footer__icp,
.site-footer__legal {
  margin: 0;
}

.site-footer__bottom a {
  color: var(--gold);
  text-decoration: none;
}

.site-footer__bottom a:hover {
  color: var(--cream);
  text-decoration: underline;
}

@media (min-width: 992px) {
  .site-header__bar {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .header-search {
    justify-self: center;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav {
    max-height: none;
    overflow: visible;
    margin-top: 0.5rem;
    background: transparent;
  }

  .nav-list {
    display: flex;
    padding: 0;
  }

  .nav-item {
    flex: 1;
    border-bottom: 0;
  }

  .nav-item + .nav-item {
    border-left: 1px solid rgba(245, 240, 230, 0.1);
  }

  .nav-link {
    justify-content: center;
    padding: 0.9rem 0.6rem;
  }

  .nav-link::after {
    content: "";
    position: absolute;
    right: 10%;
    bottom: 0.35rem;
    left: 10%;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
  }

  .nav-link:hover::after,
  .nav-link[aria-current="page"]::after {
    transform: scaleX(1);
  }

  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr) minmax(0, 0.7fr);
  }
}

@media (max-width: 991px) {
  .site-header__bar {
    grid-template-columns: 1fr auto;
  }

  .brand {
    order: 1;
  }

  .header-search {
    grid-column: 1 / -1;
    grid-row: 2;
    order: 3;
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }

  .nav-toggle {
    order: 2;
  }
}

@media (max-width: 480px) {
  .brand__sub {
    display: none;
  }

  .site-footer__bottom-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .nav-link::after {
    transition: none;
  }

  .scroll-top {
    transition: none;
  }
}
