:root {
  color-scheme: dark;
  --gold: #f2d58d;
  --gold-bright: #fff0b6;
  --deep: #07131c;
  --ink: #3f2d18;
  --paper: rgba(255, 248, 221, 0.86);
  --paper-soft: rgba(255, 246, 218, 0.58);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 50% 32%, rgba(250, 225, 150, 0.18), transparent 28%),
    linear-gradient(180deg, #102838 0%, #07131c 100%);
  color: #fff6d6;
  font-family:
    "Noto Serif SC", "Source Han Serif SC", "SimSun", "STSong", serif;
}

body.modal-open {
  overflow: hidden;
}

a,
button,
input {
  font: inherit;
}

.directory-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.directory-stage {
  position: relative;
  width: min(100vw, 150vh);
  min-height: min(100vh, 66.666vw);
  aspect-ratio: 3 / 2;
  overflow: hidden;
  isolation: isolate;
  background: var(--deep);
  box-shadow:
    0 0 0 1px rgba(255, 234, 178, 0.12),
    0 28px 96px rgba(0, 0, 0, 0.5);
}

.directory-bg {
  position: absolute;
  inset: 0;
  z-index: -5;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.page-vignette,
.mist-layer,
.floating-clouds {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.page-vignette {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(4, 18, 28, 0.38) 0%, transparent 24%, transparent 67%, rgba(4, 18, 28, 0.32) 100%),
    radial-gradient(circle at 50% 44%, rgba(255, 241, 195, 0.18), transparent 34%);
}

.mist-layer {
  left: -30%;
  width: 160%;
  height: 26%;
  z-index: 1;
  opacity: 0.12;
  filter: blur(24px);
  mix-blend-mode: screen;
  background:
    radial-gradient(ellipse at 12% 55%, rgba(255, 255, 255, 0.48), transparent 40%),
    radial-gradient(ellipse at 38% 48%, rgba(216, 242, 255, 0.32), transparent 42%),
    radial-gradient(ellipse at 68% 52%, rgba(255, 243, 202, 0.34), transparent 44%),
    radial-gradient(ellipse at 92% 56%, rgba(255, 255, 255, 0.38), transparent 42%);
}

.mist-a {
  top: 20%;
  animation: mist-drift 82s linear infinite;
}

.mist-b {
  top: 56%;
  opacity: 0.09;
  animation: mist-drift 112s linear infinite reverse;
}

.floating-clouds {
  z-index: 3;
  overflow: hidden;
}

.floating-cloud {
  position: absolute;
  left: -32%;
  top: var(--top);
  width: var(--width);
  opacity: var(--opacity);
  filter: blur(var(--blur)) brightness(1.08);
  animation: cloud-pass var(--duration) linear infinite;
  animation-delay: var(--delay);
  will-change: transform;
}

.cloud-a {
  --top: 18%;
  --width: 42%;
  --opacity: 0.2;
  --blur: 1px;
  --duration: 76s;
  --delay: -20s;
}

.cloud-b {
  --top: 39%;
  --width: 48%;
  --opacity: 0.16;
  --blur: 1.6px;
  --duration: 92s;
  --delay: -52s;
}

.cloud-c {
  --top: 64%;
  --width: 38%;
  --opacity: 0.18;
  --blur: 1.3px;
  --duration: 86s;
  --delay: -8s;
}

.cloud-d {
  --top: 10%;
  --width: 34%;
  --opacity: 0.13;
  --blur: 2px;
  --duration: 108s;
  --delay: -74s;
}

.site-header {
  position: relative;
  z-index: 20;
  height: 8%;
  min-height: 66px;
}

.brand {
  position: absolute;
  left: 2.2%;
  top: 18%;
  width: 12.5%;
  min-width: 150px;
  line-height: 0;
}

.brand img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.28));
}

.primary-nav {
  position: absolute;
  left: 22.2%;
  top: 17%;
  width: 52%;
  display: flex;
  justify-content: space-between;
  gap: 1.2vw;
}

.utility-nav {
  position: absolute;
  right: 2.4%;
  top: 17%;
  display: flex;
  gap: 1.2vw;
}

.nav-link,
.utility-link {
  position: relative;
  color: rgba(255, 232, 174, 0.88);
  text-decoration: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.36);
  transition:
    color 220ms ease,
    text-shadow 220ms ease;
}

.nav-link {
  padding: 0.3rem 0.18rem 0.68rem;
  font-size: clamp(0.95rem, 1.28vw, 1.28rem);
  white-space: nowrap;
}

.utility-link {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  padding: 0.3rem 0.1rem;
  font-size: clamp(0.82rem, 1vw, 1rem);
}

.utility-icon {
  width: 1.32em;
  height: 1.32em;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 226, 151, 0.58);
  border-radius: 999px;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.28rem;
  width: 0;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  box-shadow: 0 0 12px rgba(255, 235, 170, 0.9);
  opacity: 0;
  transition:
    width 220ms ease,
    opacity 220ms ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.is-active,
.utility-link:hover,
.utility-link:focus-visible {
  color: #fff3c2;
  text-shadow:
    0 0 10px rgba(255, 229, 158, 0.76),
    0 2px 12px rgba(0, 0, 0, 0.42);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  width: 86%;
  opacity: 1;
}

.content-shell {
  position: relative;
  z-index: 10;
  width: min(88%, 1180px);
  margin: 2.4% auto 0;
}

.page-title {
  max-width: 650px;
  margin: 0 auto 2.2%;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: rgba(93, 61, 24, 0.78);
  font-size: clamp(0.9rem, 1.05vw, 1.05rem);
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-shadow: 0 1px 8px rgba(255, 250, 220, 0.76);
}

h1 {
  margin: 0;
  color: #6a451f;
  font-size: clamp(3.2rem, 6vw, 6.2rem);
  line-height: 1;
  font-weight: 700;
  text-shadow:
    0 1px 0 #fff4c5,
    0 0 22px rgba(255, 238, 180, 0.8);
}

.title-copy {
  margin: 0.9rem 0 0;
  color: rgba(89, 60, 32, 0.82);
  font-size: clamp(0.95rem, 1.18vw, 1.15rem);
  text-shadow: 0 1px 8px rgba(255, 250, 224, 0.9);
}

.directory-panel {
  padding: clamp(1rem, 1.7vw, 1.45rem);
  border: 1px solid rgba(255, 227, 154, 0.54);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 249, 225, 0.55), rgba(255, 239, 194, 0.32)),
    rgba(16, 42, 52, 0.2);
  box-shadow:
    inset 0 0 32px rgba(255, 246, 211, 0.28),
    0 18px 58px rgba(5, 21, 30, 0.34);
  backdrop-filter: blur(10px);
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.search-box {
  display: grid;
  gap: 0.36rem;
}

.search-label,
.result-count {
  color: rgba(92, 60, 25, 0.82);
  text-shadow: 0 1px 8px rgba(255, 250, 226, 0.7);
}

.search-label {
  font-size: 0.92rem;
}

#record-search {
  width: 100%;
  min-height: 46px;
  padding: 0.72rem 1rem;
  border: 1px solid rgba(219, 173, 91, 0.58);
  border-radius: 999px;
  outline: none;
  color: #533719;
  background: rgba(255, 250, 231, 0.78);
  box-shadow: inset 0 0 16px rgba(255, 225, 149, 0.22);
}

#record-search:focus-visible {
  border-color: var(--gold-bright);
  box-shadow:
    0 0 0 3px rgba(255, 231, 161, 0.28),
    inset 0 0 16px rgba(255, 225, 149, 0.32);
}

.result-count {
  margin: 0 0 0.7rem;
  white-space: nowrap;
  font-size: 0.92rem;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.62rem;
  margin-bottom: 1rem;
}

.filter-tab {
  min-height: 34px;
  padding: 0.32rem 0.9rem;
  border: 1px solid rgba(216, 170, 86, 0.48);
  border-radius: 999px;
  color: #62401d;
  background: rgba(255, 248, 224, 0.52);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.filter-tab:hover,
.filter-tab:focus-visible,
.filter-tab.is-active {
  transform: translateY(-1px);
  border-color: rgba(255, 228, 151, 0.9);
  background: rgba(255, 244, 207, 0.86);
  box-shadow:
    0 0 16px rgba(255, 225, 140, 0.44),
    inset 0 0 14px rgba(255, 242, 198, 0.68);
}

.records-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(0.7rem, 1vw, 1rem);
}

.record-card {
  min-width: 0;
  animation: card-rise 420ms ease both;
  animation-delay: var(--delay);
}

.record-card button {
  position: relative;
  width: 100%;
  min-height: 178px;
  padding: 1rem 0.86rem;
  border: 1px solid rgba(219, 177, 91, 0.56);
  border-radius: 8px;
  color: #583a1c;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(255, 253, 236, 0.86), rgba(255, 238, 195, 0.68)),
    rgba(255, 250, 232, 0.8);
  box-shadow:
    inset 0 0 22px rgba(255, 241, 194, 0.54),
    0 12px 30px rgba(16, 48, 62, 0.22);
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.record-card button::before {
  content: "";
  position: absolute;
  inset: 0.42rem;
  border: 1px solid rgba(218, 169, 76, 0.28);
  border-radius: 6px;
  pointer-events: none;
}

.record-card button:hover,
.record-card button:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(255, 230, 157, 0.96);
  box-shadow:
    inset 0 0 26px rgba(255, 241, 194, 0.68),
    0 0 20px rgba(255, 224, 145, 0.42),
    0 18px 38px rgba(13, 39, 52, 0.34);
}

.record-card-kicker,
.record-relation,
.record-quote,
.record-status {
  display: block;
}

.record-card-kicker {
  color: rgba(144, 96, 38, 0.74);
  font-size: 0.82rem;
}

.record-card strong {
  display: block;
  margin: 0.22rem 0 0.32rem;
  color: #4d3217;
  font-size: clamp(1.25rem, 1.5vw, 1.55rem);
  font-weight: 700;
}

.record-relation {
  color: rgba(83, 54, 26, 0.76);
  font-size: 0.9rem;
}

.record-quote {
  margin-top: 0.82rem;
  min-height: 2.6em;
  color: rgba(72, 52, 33, 0.78);
  font-size: 0.88rem;
  line-height: 1.45;
}

.record-status {
  margin-top: 0.88rem;
  color: rgba(119, 76, 28, 0.88);
  font-size: 0.86rem;
}

.empty-state {
  margin: 1.1rem 0 0.2rem;
  padding: 1rem;
  border: 1px solid rgba(255, 226, 153, 0.42);
  border-radius: 8px;
  color: #674421;
  text-align: center;
  background: rgba(255, 247, 222, 0.62);
}

.modal-layer {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.modal-layer[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 229, 160, 0.18), transparent 32%),
    rgba(4, 18, 28, 0.58);
  backdrop-filter: blur(7px);
}

.record-dialog {
  position: relative;
  width: min(560px, 92vw);
  padding: 1.6rem;
  border: 1px solid rgba(255, 229, 154, 0.76);
  border-radius: 8px;
  color: #543719;
  background:
    linear-gradient(180deg, rgba(255, 253, 237, 0.95), rgba(255, 240, 204, 0.9)),
    rgba(255, 249, 224, 0.94);
  box-shadow:
    inset 0 0 42px rgba(255, 234, 173, 0.56),
    0 24px 78px rgba(0, 0, 0, 0.4);
}

.modal-close {
  position: absolute;
  top: 0.72rem;
  right: 0.72rem;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(180, 125, 46, 0.42);
  border-radius: 999px;
  color: #704619;
  background: rgba(255, 247, 218, 0.78);
  cursor: pointer;
}

.modal-close:hover,
.modal-close:focus-visible {
  box-shadow: 0 0 14px rgba(255, 221, 134, 0.7);
}

.modal-kicker {
  margin: 0;
  color: rgba(138, 91, 34, 0.76);
}

.record-dialog h2 {
  margin: 0.16rem 0 0.32rem;
  color: #4f3215;
  font-size: 2.35rem;
}

.modal-subtitle,
.modal-story {
  line-height: 1.75;
}

.modal-subtitle {
  margin: 0 0 1rem;
  color: rgba(85, 56, 29, 0.78);
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.modal-tags span {
  padding: 0.24rem 0.64rem;
  border: 1px solid rgba(204, 151, 64, 0.42);
  border-radius: 999px;
  background: rgba(255, 243, 204, 0.8);
}

.modal-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.72rem;
  margin: 0 0 1rem;
}

.modal-details div {
  padding: 0.72rem;
  border: 1px solid rgba(210, 164, 78, 0.32);
  border-radius: 8px;
  background: rgba(255, 250, 230, 0.72);
}

.modal-details dt {
  color: rgba(123, 80, 28, 0.7);
  font-size: 0.78rem;
}

.modal-details dd {
  margin: 0.22rem 0 0;
}

.modal-story {
  margin: 0;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.modal-actions a {
  min-width: 112px;
  padding: 0.58rem 0.8rem;
  border: 1px solid rgba(200, 142, 42, 0.56);
  border-radius: 999px;
  color: #5a390f;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(180deg, #fff5c8, #e6b957);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.66),
    0 0 16px rgba(255, 218, 120, 0.42);
}

.modal-actions a:hover,
.modal-actions a:focus-visible {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 0 22px rgba(255, 225, 137, 0.72);
}

@keyframes mist-drift {
  from {
    transform: translate3d(-6%, 0, 0);
  }

  to {
    transform: translate3d(6%, 0, 0);
  }
}

@keyframes cloud-pass {
  from {
    transform: translate3d(-5vw, 0, 0);
  }

  to {
    transform: translate3d(150vw, 0, 0);
  }
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  body {
    overflow: auto;
  }

  .directory-page {
    display: block;
  }

  .directory-stage {
    width: 100%;
    min-height: 100vh;
    aspect-ratio: auto;
    overflow: visible;
  }

  .site-header {
    height: auto;
    min-height: 0;
    padding: 0.85rem 1rem 0;
  }

  .brand,
  .primary-nav,
  .utility-nav {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    width: auto;
  }

  .brand {
    display: block;
    width: 170px;
    min-width: 0;
    margin-bottom: 0.7rem;
  }

  .primary-nav,
  .utility-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .utility-nav {
    margin-top: 0.35rem;
  }

  .content-shell {
    width: min(92%, 720px);
    margin-top: 1.5rem;
    padding-bottom: 2rem;
  }

  h1 {
    font-size: clamp(3rem, 16vw, 4.8rem);
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .result-count {
    margin: 0;
  }

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

  .modal-layer {
    position: fixed;
  }
}

@media (max-width: 560px) {
  .records-grid,
  .modal-details {
    grid-template-columns: 1fr;
  }

  .directory-panel {
    padding: 0.9rem;
  }

  .record-card button {
    min-height: 150px;
  }
}

.mobile-search-field {
  display: contents;
}

.search-clear,
.record-card-portrait,
.record-card-copy {
  display: none;
}

@media (max-width: 700px) {
  .directory-page {
    display: block;
    min-height: 100svh;
  }

  .directory-stage {
    width: 100%;
    min-height: 100svh;
    aspect-ratio: auto;
    overflow: visible;
  }

  .directory-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100svh;
    object-fit: cover;
    object-position: center top;
  }

  .content-shell {
    position: relative;
    z-index: 20;
    width: 100%;
    margin: 0;
    padding: calc(var(--mobile-topbar-height) + var(--mobile-safe-top) + 18px)
      max(14px, var(--mobile-safe-right)) max(34px, var(--mobile-safe-bottom))
      max(14px, var(--mobile-safe-left));
  }

  .directory-panel {
    width: 100%;
    min-height: 0;
    padding: 18px 14px 22px;
    border: 1px solid rgba(184, 125, 39, 0.45);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 247, 214, 0.96), rgba(235, 197, 107, 0.94));
    box-shadow: 0 18px 48px rgba(18, 47, 54, 0.26);
  }

  .search-row {
    display: grid;
    width: 100%;
    gap: 10px;
    margin: 0 0 12px;
  }

  .mobile-search-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px;
    align-items: end;
    gap: 10px;
  }

  .search-box {
    width: 100%;
  }

  .search-label {
    display: block;
    margin: 0 0 6px 4px;
    font-size: 17px;
  }

  .search-box input {
    width: 100%;
    min-height: 54px;
    padding: 0 15px;
    font-size: 17px;
  }

  .search-clear {
    display: inline-flex;
    min-width: 64px;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(130, 82, 27, 0.38);
    border-radius: 999px;
    color: #60401f;
    background: rgba(255, 252, 230, 0.7);
    font: inherit;
  }

  .result-count {
    min-height: 24px;
    margin: 0;
    font-size: 15px;
  }

  .filter-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 16px;
  }

  .filter-tab {
    min-width: 0;
    min-height: 48px;
    padding: 6px;
    font-size: 15px;
    white-space: normal;
  }

  .records-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
    min-height: 0;
    padding: 0;
  }

  .record-card {
    display: block;
    width: 100%;
    max-width: none;
    flex: none;
  }

  .record-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    width: calc(50% - 7px);
    justify-self: center;
  }

  .record-card button {
    display: grid;
    width: 100%;
    height: auto;
    min-height: 246px;
    grid-template-rows: minmax(150px, 1fr) auto;
    gap: 10px;
    padding: 12px 10px 14px;
    overflow: hidden;
    border: 1px solid rgba(128, 83, 31, 0.32);
    border-radius: 14px;
    color: #51351a;
    background: rgba(255, 253, 238, 0.78);
    box-shadow: 0 8px 20px rgba(70, 50, 27, 0.14);
  }

  .record-card button:hover,
  .record-card button:focus-visible {
    transform: none;
    background: rgba(255, 253, 238, 0.92);
  }

  .record-card-portrait {
    display: grid;
    width: 100%;
    aspect-ratio: 4 / 5;
    max-height: 190px;
    place-items: center;
    overflow: hidden;
    border: 2px solid rgba(186, 139, 61, 0.48);
    border-radius: 50% 50% 12px 12px / 34% 34% 12px 12px;
    background: #e7ead9;
  }

  .record-card-portrait img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
  }

  .record-card-no-photo {
    display: grid;
    justify-items: center;
    gap: 5px;
    color: #805825;
    font-family: "STKaiti", "KaiTi", serif;
    font-size: 2rem;
  }

  .record-card-no-photo small {
    font-family: system-ui, sans-serif;
    font-size: 14px;
  }

  .record-card-copy {
    display: grid;
    gap: 4px;
  }

  .record-card-kicker,
  .record-card .record-name,
  .record-relation,
  .record-status {
    position: static;
    display: block;
    max-height: none;
    min-height: 0;
    margin: 0;
    transform: none;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    letter-spacing: normal;
    text-shadow: none;
  }

  .record-card .record-name {
    overflow-wrap: anywhere;
    color: #4f3218;
    font-size: 18px;
    line-height: 1.35;
  }

  .record-relation,
  .record-status {
    color: rgba(77, 51, 25, 0.72);
    font-size: 15px;
    line-height: 1.4;
  }

  .modal-layer {
    position: fixed;
    z-index: 1120;
    padding: 12px;
  }

  .record-dialog {
    width: 100%;
    max-height: 88svh;
    padding: 56px 16px 20px;
    overflow: auto;
  }

  .modal-close {
    width: 48px;
    height: 48px;
  }

  .modal-actions {
    gap: 10px;
    margin-top: 14px;
  }

  .modal-actions a {
    display: inline-flex;
    min-width: 0;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0 12px;
    font-size: 15px;
    line-height: 1;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Final scroll and memorial tablet overrides */
.content-shell {
  width: min(86%, 1320px);
  margin: 5.1% auto 0;
}

.directory-panel {
  min-height: clamp(610px, 67vh, 705px);
  padding: clamp(1.1rem, 1.5vw, 1.55rem) clamp(4rem, 5.2vw, 5.8rem) clamp(1.45rem, 2vw, 2rem);
  overflow: visible;
  border-color: rgba(194, 134, 47, 0.58);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 238, 0.42), transparent 48%),
    linear-gradient(90deg, rgba(136, 88, 27, 0.17), transparent 8%, transparent 92%, rgba(136, 88, 27, 0.15)),
    repeating-linear-gradient(0deg, rgba(117, 78, 27, 0.04) 0 1px, transparent 1px 19px),
    linear-gradient(180deg, rgba(255, 250, 221, 0.96), rgba(255, 235, 181, 0.86));
}

.directory-panel::before,
.directory-panel::after {
  inset: auto;
  top: -0.72rem;
  bottom: -0.72rem;
  width: clamp(36px, 3.2vw, 48px);
  border: 1px solid rgba(143, 91, 28, 0.62);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 3%, #fff0a8 0 12%, #c38b36 13% 24%, transparent 25%),
    radial-gradient(circle at 50% 97%, #fff0a8 0 12%, #c38b36 13% 24%, transparent 25%),
    linear-gradient(90deg, #604122 0%, #bb832f 20%, #f2d389 45%, #8a5a23 70%, #3b2819 100%);
  box-shadow:
    inset 8px 0 14px rgba(255, 231, 143, 0.26),
    inset -10px 0 18px rgba(50, 28, 12, 0.36),
    0 0 22px rgba(255, 220, 126, 0.24),
    0 16px 34px rgba(0, 0, 0, 0.24);
  opacity: 1;
  transform: none;
  mix-blend-mode: normal;
  z-index: 3;
}

.directory-panel::before {
  left: clamp(0.4rem, 0.8vw, 0.8rem);
}

.directory-panel::after {
  right: clamp(0.4rem, 0.8vw, 0.8rem);
  left: auto;
}

.records-grid {
  min-height: clamp(410px, 47vh, 500px);
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: clamp(0.55rem, 0.86vw, 0.9rem);
  padding: 0.3rem 0.15rem 0.12rem;
  overflow: visible;
}

.book-page,
.book-page-left,
.book-page-right {
  display: contents;
}

.record-card {
  flex: 0 1 clamp(86px, 7.05vw, 104px);
  height: auto;
}

.record-card button {
  position: relative;
  min-height: clamp(400px, 45vh, 482px);
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  justify-items: center;
  align-items: start;
  gap: 0.32rem;
  padding: clamp(1.05rem, 1.25vw, 1.35rem) 0.38rem 0.58rem;
  border: 1px solid rgba(181, 122, 39, 0.58);
  border-radius: 44% 44% 8px 8px / 8% 8% 8px 8px;
  color: #4d3014;
  background:
    radial-gradient(ellipse at 50% 7%, rgba(255, 255, 247, 0.9), transparent 26%),
    linear-gradient(180deg, rgba(255, 252, 228, 0.96), rgba(255, 239, 188, 0.9) 68%, rgba(255, 229, 158, 0.9)),
    repeating-linear-gradient(90deg, rgba(111, 72, 25, 0.045) 0 1px, transparent 1px 18px);
  box-shadow:
    inset 0 0 0 4px rgba(255, 246, 209, 0.5),
    inset 0 0 18px rgba(121, 75, 20, 0.12),
    0 8px 16px rgba(87, 55, 19, 0.16),
    0 0 14px rgba(255, 222, 139, 0.22);
}

.record-card button::before {
  inset: 0.42rem;
  border: 1px solid rgba(172, 107, 29, 0.28);
  border-radius: 42% 42% 6px 6px / 8% 8% 6px 6px;
  background:
    linear-gradient(180deg, rgba(255, 248, 213, 0.18), transparent 35%),
    linear-gradient(90deg, rgba(156, 101, 28, 0.2), transparent 14%, transparent 86%, rgba(156, 101, 28, 0.18));
}

.record-card button::after {
  content: "";
  position: absolute;
  left: 19%;
  right: 19%;
  top: 0.58rem;
  height: 0.34rem;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(198, 137, 41, 0.7), rgba(255, 238, 167, 0.95), rgba(198, 137, 41, 0.7), transparent);
  box-shadow: 0 0 9px rgba(255, 222, 139, 0.62);
  pointer-events: none;
}

.record-card button > * {
  position: relative;
  z-index: 1;
}

.record-card .record-name,
.record-card-kicker,
.record-relation,
.record-home,
.record-quote,
.record-status {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.record-card .record-name {
  min-height: 4.5em;
  margin: 0.05rem 0 0;
  color: #4b2e12;
  font-size: clamp(1.55rem, 1.82vw, 2rem);
  line-height: 1.02;
  letter-spacing: 0.14em;
}

.record-card-kicker,
.record-relation,
.record-status {
  max-height: 6.8em;
  overflow: hidden;
  color: rgba(126, 79, 23, 0.78);
  font-size: clamp(0.68rem, 0.75vw, 0.8rem);
  line-height: 1.16;
}

.record-home,
.record-quote {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.incense-image {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  width: min(92%, 86px);
  max-height: 82px;
  align-self: end;
  object-fit: contain;
  object-position: center bottom;
  filter:
    saturate(0.98)
    drop-shadow(0 5px 8px rgba(83, 49, 15, 0.24));
  pointer-events: none;
}

@media (max-width: 920px) {
  .directory-panel {
    padding-inline: 1.1rem;
  }

  .directory-panel::before,
  .directory-panel::after {
    display: none;
  }

  .records-grid {
    flex-wrap: wrap;
  }

  .record-card {
    flex-basis: clamp(86px, 18vw, 112px);
  }

  .record-card button {
    min-height: 310px;
  }
}

@media (max-width: 560px) {
  .record-card {
    flex-basis: min(30vw, 116px);
  }

  .record-card button {
    min-height: 270px;
  }

  .incense-image {
    max-height: 68px;
  }
}

/* The live desktop card keeps its name inside this mobile-friendly wrapper. */
@media (min-width: 701px) {
  .record-card-copy {
    display: contents;
  }
}

/* Use provided scroll artwork as the directory canvas */
.content-shell {
  width: min(88%, 1360px);
  margin: 5.1% auto 0;
}

.directory-panel {
  aspect-ratio: 4261 / 2146;
  min-height: 0;
  padding: clamp(1.25rem, 2vw, 2rem) clamp(7rem, 9.7vw, 9.4rem) clamp(1.8rem, 2.8vw, 2.8rem);
  border: 0;
  border-radius: 0;
  background: url("./images/hjz001.webp") center / 100% 100% no-repeat;
  box-shadow:
    0 22px 62px rgba(5, 21, 30, 0.32),
    0 0 28px rgba(255, 222, 126, 0.16);
  backdrop-filter: none;
}

.directory-panel::before,
.directory-panel::after {
  display: none;
}

.search-row {
  width: min(93%, 1040px);
  margin-bottom: 0.64rem;
}

.filter-tabs {
  margin-bottom: 0.9rem;
}

.records-grid {
  min-height: clamp(360px, 40vh, 430px);
  align-items: stretch;
  gap: clamp(0.48rem, 0.75vw, 0.82rem);
  padding-top: 0.18rem;
}

.record-card {
  flex-basis: clamp(78px, 6.5vw, 96px);
}

.record-card button {
  min-height: clamp(345px, 38vh, 410px);
}

.incense-image {
  width: min(90%, 76px);
  max-height: 70px;
}

@media (max-width: 920px) {
  .directory-panel {
    aspect-ratio: auto;
    padding: 1.2rem;
    background:
      linear-gradient(180deg, rgba(255, 242, 184, 0.94), rgba(255, 211, 88, 0.86));
    border: 1px solid rgba(194, 134, 47, 0.46);
    border-radius: 8px;
  }

  .records-grid {
    min-height: 0;
  }
}

/* Final jade tablet artwork override */
.records-grid {
  gap: clamp(0.44rem, 0.68vw, 0.74rem);
}

.record-card {
  flex: 0 1 clamp(88px, 6.65vw, 106px);
  container-type: inline-size;
}

.record-card button {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(300px, 35.5vh, 362px);
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #3f2b16;
  background: url("./images/web/tablet-paiwei.webp") center top / contain no-repeat;
  box-shadow: none;
  overflow: visible;
}

.record-card button::before,
.record-card button::after {
  display: none;
}

.record-card button:hover,
.record-card button:focus-visible {
  transform: translateY(-5px);
  filter:
    drop-shadow(0 0 14px rgba(143, 224, 195, 0.45))
    drop-shadow(0 12px 18px rgba(32, 63, 54, 0.22));
  background: url("./images/web/tablet-paiwei.webp") center top / contain no-repeat;
  box-shadow: none;
}

.record-card-kicker,
.record-card .record-name,
.record-relation,
.record-status {
  position: absolute;
  z-index: 2;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  margin: 0;
  text-shadow:
    0 1px 0 rgba(246, 255, 238, 0.72),
    0 0 8px rgba(227, 255, 238, 0.42);
}

.record-card-kicker {
  top: 24%;
  right: 19%;
  max-height: 7em;
  color: rgba(67, 86, 57, 0.76);
  font-size: clamp(0.64rem, 0.68vw, 0.74rem);
  line-height: 1.08;
}

.record-card .record-name {
  top: 18.5%;
  left: 50%;
  width: 1.2em;
  height: 56%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transform: translateX(-50%);
  overflow: hidden;
  color: rgba(255, 255, 255, 0.96);
  text-shadow:
    0 1px 2px rgba(22, 64, 54, 0.66),
    0 0 8px rgba(255, 255, 255, 0.48),
    0 0 16px rgba(143, 224, 195, 0.36);
  font-size: clamp(2.6rem, 3.1vw, 3rem);
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.record-relation {
  top: 25%;
  left: 19%;
  max-height: 4.5em;
  color: rgba(72, 62, 38, 0.72);
  font-size: clamp(0.66rem, 0.7vw, 0.76rem);
  line-height: 1.08;
}

.record-status {
  right: 20%;
  bottom: 25%;
  max-height: 6.2em;
  color: rgba(81, 72, 39, 0.78);
  font-size: clamp(0.62rem, 0.66vw, 0.72rem);
  line-height: 1.08;
}

.record-home,
.record-quote {
  display: none;
}

.incense-image {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 7%;
  width: min(68%, 70px);
  max-height: 58px;
  transform: translateX(-50%);
  object-fit: contain;
  object-position: center bottom;
  filter:
    saturate(0.98)
    drop-shadow(0 5px 8px rgba(39, 67, 56, 0.24));
}

@media (max-width: 1200px) {
  .record-card .record-name {
    top: 20%;
    font-size: clamp(1.15rem, 34cqw, 2.35rem);
  }
}

@media (max-width: 920px) {
  .record-card {
    flex-basis: clamp(96px, 20vw, 122px);
  }

  .record-card button {
    height: clamp(318px, 52vw, 392px);
  }

  .record-card .record-name {
    font-size: clamp(1.2rem, 4vw, 1.9rem);
  }
}

@media (max-width: 560px) {
  .record-card {
    flex-basis: min(30vw, 116px);
  }

  .record-card button {
    height: clamp(286px, 86vw, 360px);
  }

  .record-card .record-name {
    font-size: clamp(1rem, 6.2vw, 1.5rem);
  }

  .incense-image {
    max-height: 52px;
  }
}

/* Keep the jade-tablet name prominent without overflowing narrow cards. */
.record-card {
  container-type: inline-size;
}

.record-card .record-name {
  top: 18.5%;
  left: 50%;
  width: 1.2em;
  height: 56%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transform: translateX(-50%);
  overflow: hidden;
  color: rgba(255, 255, 255, 0.98);
  font-size: clamp(2.6rem, 3.1vw, 3rem);
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .record-card .record-name {
    top: 20%;
    font-size: clamp(1.15rem, 34cqw, 2.35rem);
  }
}

@media (max-width: 920px) {
  .record-card .record-name {
    font-size: clamp(1.2rem, 4vw, 1.9rem);
  }
}

@media (max-width: 560px) {
  .record-card .record-name {
    font-size: clamp(1rem, 6.2vw, 1.5rem);
  }
}

/* Final responsive name sizing for the jade tablet artwork. */
.record-card {
  container-type: inline-size;
}

.record-card .record-name {
  top: 18.5%;
  left: 50%;
  width: 1.2em;
  height: 56%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transform: translateX(-50%);
  overflow: hidden;
  color: rgba(255, 255, 255, 0.98);
  font-size: clamp(2.6rem, 3.1vw, 3rem);
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .record-card .record-name {
    top: 20%;
    font-size: clamp(1.15rem, 34cqw, 2.35rem);
  }
}

@media (max-width: 920px) {
  .record-card .record-name {
    font-size: clamp(1.2rem, 4vw, 1.9rem);
  }
}

@media (max-width: 560px) {
  .record-card .record-name {
    font-size: clamp(1rem, 6.2vw, 1.5rem);
  }
}

/* Effective final name-only tablet text */
.record-card .record-name {
  color: rgba(255, 255, 255, 0.96);
  text-shadow:
    0 1px 2px rgba(22, 64, 54, 0.66),
    0 0 8px rgba(255, 255, 255, 0.48),
    0 0 16px rgba(143, 224, 195, 0.36);
}

.record-card-kicker,
.record-relation,
.record-home,
.record-quote,
.record-status {
  display: none;
}

/* Name-only jade tablet final text style */
.record-card .record-name {
  color: rgba(255, 255, 255, 0.96);
  text-shadow:
    0 1px 2px rgba(22, 64, 54, 0.66),
    0 0 8px rgba(255, 255, 255, 0.48),
    0 0 16px rgba(143, 224, 195, 0.36);
}

.record-card-kicker,
.record-relation,
.record-home,
.record-quote,
.record-status {
  display: none;
}

/* Jade tablet artwork replacement */
.records-grid {
  gap: clamp(0.44rem, 0.68vw, 0.74rem);
}

.record-card {
  flex: 0 1 clamp(88px, 6.65vw, 106px);
}

.record-card button {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(300px, 35.5vh, 362px);
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #3f2b16;
  background: url("./images/web/tablet-paiwei.webp") center top / contain no-repeat;
  box-shadow: none;
  overflow: visible;
}

.record-card button::before,
.record-card button::after {
  display: none;
}

.record-card button:hover,
.record-card button:focus-visible {
  transform: translateY(-5px);
  filter:
    drop-shadow(0 0 14px rgba(143, 224, 195, 0.45))
    drop-shadow(0 12px 18px rgba(32, 63, 54, 0.22));
  background: url("./images/web/tablet-paiwei.webp") center top / contain no-repeat;
  box-shadow: none;
}

.record-card-kicker,
.record-card .record-name,
.record-relation,
.record-status {
  position: absolute;
  z-index: 2;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  margin: 0;
  text-shadow:
    0 1px 0 rgba(246, 255, 238, 0.72),
    0 0 8px rgba(227, 255, 238, 0.42);
}

.record-card-kicker {
  top: 24%;
  right: 19%;
  max-height: 7em;
  color: rgba(67, 86, 57, 0.76);
  font-size: clamp(0.64rem, 0.68vw, 0.74rem);
  line-height: 1.08;
}

.record-card .record-name {
  top: 25%;
  left: 50%;
  min-height: 4.4em;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.96);
  text-shadow:
    0 1px 2px rgba(22, 64, 54, 0.66),
    0 0 8px rgba(255, 255, 255, 0.48),
    0 0 16px rgba(143, 224, 195, 0.36);
  font-size: clamp(1.28rem, 1.46vw, 1.62rem);
  line-height: 1.02;
  letter-spacing: 0.16em;
}

.record-relation {
  top: 25%;
  left: 19%;
  max-height: 4.5em;
  color: rgba(72, 62, 38, 0.72);
  font-size: clamp(0.66rem, 0.7vw, 0.76rem);
  line-height: 1.08;
}

.record-status {
  right: 20%;
  bottom: 25%;
  max-height: 6.2em;
  color: rgba(81, 72, 39, 0.78);
  font-size: clamp(0.62rem, 0.66vw, 0.72rem);
  line-height: 1.08;
}

.record-home,
.record-quote {
  display: none;
}

.incense-image {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 7%;
  width: min(68%, 70px);
  max-height: 58px;
  transform: translateX(-50%);
  object-fit: contain;
  object-position: center bottom;
  filter:
    saturate(0.98)
    drop-shadow(0 5px 8px rgba(39, 67, 56, 0.24));
}

@media (max-width: 920px) {
  .record-card {
    flex-basis: clamp(96px, 20vw, 122px);
  }

  .record-card button {
    height: clamp(318px, 52vw, 392px);
  }
}

@media (max-width: 560px) {
  .record-card {
    flex-basis: min(30vw, 116px);
  }

  .record-card button {
    height: clamp(286px, 86vw, 360px);
  }

  .incense-image {
    max-height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Scroll and memorial tablet refinement */
.content-shell {
  width: min(86%, 1320px);
  margin: 5.1% auto 0;
}

.directory-panel {
  min-height: clamp(610px, 67vh, 705px);
  padding: clamp(1.1rem, 1.5vw, 1.55rem) clamp(4rem, 5.2vw, 5.8rem) clamp(1.45rem, 2vw, 2rem);
  overflow: visible;
  border-color: rgba(194, 134, 47, 0.58);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 238, 0.42), transparent 48%),
    linear-gradient(90deg, rgba(136, 88, 27, 0.17), transparent 8%, transparent 92%, rgba(136, 88, 27, 0.15)),
    repeating-linear-gradient(0deg, rgba(117, 78, 27, 0.04) 0 1px, transparent 1px 19px),
    linear-gradient(180deg, rgba(255, 250, 221, 0.96), rgba(255, 235, 181, 0.86));
  box-shadow:
    inset 0 0 46px rgba(116, 73, 22, 0.16),
    inset 0 0 96px rgba(255, 245, 203, 0.36),
    0 20px 62px rgba(5, 21, 30, 0.3),
    0 0 24px rgba(255, 223, 133, 0.16);
}

.directory-panel::before,
.directory-panel::after {
  top: -0.72rem;
  bottom: -0.72rem;
  width: clamp(36px, 3.2vw, 48px);
  border: 1px solid rgba(143, 91, 28, 0.62);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 3%, #fff0a8 0 12%, #c38b36 13% 24%, transparent 25%),
    radial-gradient(circle at 50% 97%, #fff0a8 0 12%, #c38b36 13% 24%, transparent 25%),
    linear-gradient(90deg, #604122 0%, #bb832f 20%, #f2d389 45%, #8a5a23 70%, #3b2819 100%);
  box-shadow:
    inset 8px 0 14px rgba(255, 231, 143, 0.26),
    inset -10px 0 18px rgba(50, 28, 12, 0.36),
    0 0 22px rgba(255, 220, 126, 0.24),
    0 16px 34px rgba(0, 0, 0, 0.24);
  opacity: 1;
  mix-blend-mode: normal;
  z-index: 3;
}

.directory-panel::before {
  left: clamp(0.4rem, 0.8vw, 0.8rem);
  transform: none;
}

.directory-panel::after {
  right: clamp(0.4rem, 0.8vw, 0.8rem);
  left: auto;
}

.search-row {
  width: min(94%, 1040px);
  margin-bottom: 0.78rem;
}

.filter-tabs {
  margin-bottom: 1.08rem;
}

.records-grid {
  min-height: clamp(410px, 47vh, 500px);
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: clamp(0.55rem, 0.86vw, 0.9rem);
  padding: 0.3rem 0.15rem 0.12rem;
  overflow: visible;
}

.book-page,
.book-page-left,
.book-page-right {
  display: contents;
}

.record-card {
  flex: 0 1 clamp(86px, 7.05vw, 104px);
  height: auto;
}

.record-card button {
  position: relative;
  min-height: clamp(400px, 45vh, 482px);
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  justify-items: center;
  align-items: start;
  gap: 0.32rem;
  padding: clamp(1.05rem, 1.25vw, 1.35rem) 0.38rem 0.58rem;
  border: 1px solid rgba(181, 122, 39, 0.58);
  border-radius: 44% 44% 8px 8px / 8% 8% 8px 8px;
  color: #4d3014;
  background:
    radial-gradient(ellipse at 50% 7%, rgba(255, 255, 247, 0.9), transparent 26%),
    linear-gradient(180deg, rgba(255, 252, 228, 0.96), rgba(255, 239, 188, 0.9) 68%, rgba(255, 229, 158, 0.9)),
    repeating-linear-gradient(90deg, rgba(111, 72, 25, 0.045) 0 1px, transparent 1px 18px);
  box-shadow:
    inset 0 0 0 4px rgba(255, 246, 209, 0.5),
    inset 0 0 18px rgba(121, 75, 20, 0.12),
    0 8px 16px rgba(87, 55, 19, 0.16),
    0 0 14px rgba(255, 222, 139, 0.22);
}

.record-card button::before {
  inset: 0.42rem;
  border: 1px solid rgba(172, 107, 29, 0.28);
  border-radius: 42% 42% 6px 6px / 8% 8% 6px 6px;
  background:
    linear-gradient(180deg, rgba(255, 248, 213, 0.18), transparent 35%),
    linear-gradient(90deg, rgba(156, 101, 28, 0.2), transparent 14%, transparent 86%, rgba(156, 101, 28, 0.18));
}

.record-card button::after {
  content: "";
  position: absolute;
  left: 19%;
  right: 19%;
  top: 0.58rem;
  height: 0.34rem;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(198, 137, 41, 0.7), rgba(255, 238, 167, 0.95), rgba(198, 137, 41, 0.7), transparent);
  box-shadow: 0 0 9px rgba(255, 222, 139, 0.62);
  pointer-events: none;
}

.record-card button:hover,
.record-card button:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(255, 224, 142, 0.96);
  box-shadow:
    inset 0 0 0 4px rgba(255, 250, 220, 0.66),
    inset 0 0 22px rgba(121, 75, 20, 0.14),
    0 0 24px rgba(255, 224, 142, 0.5),
    0 16px 28px rgba(87, 55, 19, 0.22);
}

.record-card button > * {
  position: relative;
  z-index: 1;
}

.record-card-kicker,
.record-relation,
.record-home,
.record-quote,
.record-status {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  margin: 0;
}

.record-card-kicker {
  justify-self: end;
  color: rgba(126, 79, 23, 0.76);
  font-size: clamp(0.68rem, 0.75vw, 0.8rem);
  line-height: 1.18;
  max-height: 6.8em;
  overflow: hidden;
}

.record-card .record-name {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  min-height: 4.5em;
  margin: 0.05rem 0 0;
  color: #4b2e12;
  font-size: clamp(1.55rem, 1.82vw, 2rem);
  line-height: 1.02;
  letter-spacing: 0.14em;
}

.record-relation {
  color: rgba(97, 61, 20, 0.74);
  font-size: clamp(0.76rem, 0.82vw, 0.88rem);
  line-height: 1.18;
}

.record-home,
.record-quote {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.record-status {
  color: rgba(127, 80, 23, 0.82);
  font-size: clamp(0.68rem, 0.75vw, 0.8rem);
  line-height: 1.16;
  max-height: 6.4em;
  overflow: hidden;
}

.incense-image {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  width: min(92%, 86px);
  max-height: 82px;
  align-self: end;
  object-fit: contain;
  object-position: center bottom;
  filter:
    saturate(0.98)
    drop-shadow(0 5px 8px rgba(83, 49, 15, 0.24));
  pointer-events: none;
}

.empty-state {
  margin-top: 1.2rem;
  background:
    linear-gradient(180deg, rgba(255, 249, 217, 0.92), rgba(255, 234, 181, 0.82));
}

@media (max-width: 920px) {
  .directory-panel {
    padding-inline: 1.1rem;
  }

  .directory-panel::before,
  .directory-panel::after {
    display: none;
  }

  .records-grid {
    flex-wrap: wrap;
    overflow: visible;
  }

  .record-card {
    flex-basis: clamp(86px, 18vw, 112px);
  }

  .record-card button {
    min-height: 310px;
  }
}

@media (max-width: 560px) {
  .records-grid {
    justify-content: center;
  }

  .record-card {
    flex-basis: min(30vw, 116px);
  }

  .record-card button {
    min-height: 270px;
  }

  .incense-image {
    max-height: 68px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Ancient book directory layout */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.content-shell {
  width: min(82%, 1240px);
  margin: 5.2% auto 0;
}

.page-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
}

.directory-panel {
  position: relative;
  min-height: clamp(600px, 68vh, 710px);
  padding: clamp(1.2rem, 1.7vw, 1.7rem) clamp(1.25rem, 2vw, 2.2rem) clamp(1.35rem, 2vw, 2rem);
  overflow: hidden;
  border: 1px solid rgba(184, 126, 44, 0.58);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(142, 94, 34, 0.16), transparent 7%, transparent 93%, rgba(142, 94, 34, 0.14)),
    radial-gradient(ellipse at 50% 50%, rgba(139, 92, 33, 0.2), transparent 2.7%, transparent 4.1%, rgba(255, 244, 204, 0.08) 4.7%, transparent 6.2%),
    linear-gradient(90deg, rgba(255, 248, 219, 0.94) 0%, rgba(255, 240, 191, 0.82) 49.4%, rgba(146, 92, 32, 0.18) 50%, rgba(255, 242, 198, 0.82) 50.6%, rgba(255, 249, 224, 0.94) 100%);
  box-shadow:
    inset 0 0 34px rgba(118, 74, 25, 0.18),
    inset 0 0 82px rgba(255, 243, 195, 0.34),
    0 18px 60px rgba(5, 21, 30, 0.28),
    0 0 26px rgba(255, 220, 126, 0.16);
  backdrop-filter: blur(6px);
}

.directory-panel::before,
.directory-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.directory-panel::before {
  top: 1.1rem;
  bottom: 1.1rem;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(129, 79, 28, 0.34), rgba(255, 238, 180, 0.34), rgba(129, 79, 28, 0.3), transparent);
  box-shadow:
    -10px 0 22px rgba(92, 54, 18, 0.12),
    10px 0 22px rgba(255, 250, 225, 0.28);
  z-index: 0;
}

.directory-panel::after {
  inset: 0.72rem;
  border: 1px solid rgba(177, 119, 42, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(110deg, transparent 0%, rgba(127, 84, 29, 0.08) 18%, transparent 36%, rgba(255, 255, 244, 0.18) 58%, transparent 78%),
    repeating-linear-gradient(0deg, rgba(116, 79, 32, 0.035) 0 1px, transparent 1px 17px);
  mix-blend-mode: multiply;
  opacity: 0.55;
  z-index: 0;
}

.search-row,
.filter-tabs,
.records-grid,
.empty-state {
  position: relative;
  z-index: 2;
}

.search-row {
  width: min(94%, 1080px);
  margin: 0 auto 0.72rem;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.search-label {
  padding-left: 0.72rem;
  color: rgba(91, 56, 17, 0.72);
}

#record-search {
  min-height: 42px;
  border-color: rgba(196, 135, 42, 0.46);
  color: #533719;
  background:
    linear-gradient(180deg, rgba(255, 252, 233, 0.88), rgba(255, 241, 199, 0.82));
  box-shadow:
    inset 0 0 20px rgba(151, 98, 35, 0.1),
    0 2px 0 rgba(255, 255, 255, 0.36);
}

.result-count {
  color: rgba(87, 53, 17, 0.76);
}

.filter-tabs {
  justify-content: center;
  gap: 0.72rem;
  margin-bottom: 1rem;
}

.filter-tab {
  border-color: rgba(185, 126, 42, 0.45);
  border-radius: 4px 4px 12px 12px;
  color: #60401d;
  background:
    linear-gradient(180deg, rgba(255, 244, 202, 0.92), rgba(231, 187, 91, 0.54));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    0 4px 10px rgba(103, 62, 16, 0.12);
}

.filter-tab:hover,
.filter-tab:focus-visible,
.filter-tab.is-active {
  border-color: rgba(255, 226, 142, 0.95);
  background:
    linear-gradient(180deg, #fff2bd, #e4b65f);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 0 18px rgba(255, 218, 126, 0.48);
}

.records-grid {
  min-height: clamp(410px, 48vh, 500px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 0.2rem 0 0;
}

.book-page {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(0.42rem, 0.7vw, 0.7rem);
  padding: clamp(0.7rem, 1.1vw, 1rem) clamp(0.8rem, 1.35vw, 1.45rem);
  background:
    radial-gradient(ellipse at 50% 5%, rgba(255, 255, 247, 0.42), transparent 58%),
    repeating-linear-gradient(90deg, rgba(120, 76, 26, 0.04) 0 1px, transparent 1px 13%);
}

.book-page-left {
  padding-right: clamp(1.1rem, 1.8vw, 1.8rem);
}

.book-page-right {
  padding-left: clamp(1.1rem, 1.8vw, 1.8rem);
}

.record-card {
  min-width: 0;
  height: 100%;
}

.record-card button {
  width: 100%;
  height: 100%;
  min-height: clamp(380px, 44vh, 470px);
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(0.22rem, 0.42vw, 0.42rem);
  padding: 0.95rem 0.46rem;
  border: 1px solid rgba(185, 126, 42, 0.38);
  border-radius: 8px;
  color: #563718;
  text-align: start;
  background:
    linear-gradient(180deg, rgba(255, 252, 234, 0.88), rgba(255, 239, 193, 0.76)),
    repeating-linear-gradient(90deg, rgba(119, 75, 26, 0.05) 0 1px, transparent 1px 18px);
  box-shadow:
    inset 0 0 20px rgba(126, 80, 24, 0.08),
    0 8px 18px rgba(87, 55, 19, 0.12);
}

.record-card button::before {
  inset: 0.38rem;
  border-color: rgba(169, 105, 31, 0.18);
}

.record-card button:hover,
.record-card button:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(255, 222, 137, 0.95);
  background:
    linear-gradient(180deg, rgba(255, 255, 241, 0.96), rgba(255, 240, 195, 0.86)),
    repeating-linear-gradient(90deg, rgba(119, 75, 26, 0.045) 0 1px, transparent 1px 18px);
}

.record-card button > * {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0;
}

.record-card-kicker {
  color: rgba(130, 82, 26, 0.72);
  font-size: clamp(0.72rem, 0.82vw, 0.86rem);
  line-height: 1.2;
}

.record-card .record-name {
  margin: 0;
  color: #4d3217;
  font-size: clamp(1.5rem, 1.9vw, 2rem);
  line-height: 1.05;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 0 rgba(255, 242, 198, 0.82);
}

.record-relation,
.record-home,
.record-quote,
.record-status {
  margin: 0;
  color: rgba(75, 51, 28, 0.76);
  font-size: clamp(0.72rem, 0.82vw, 0.86rem);
  line-height: 1.28;
  max-height: 18em;
  overflow: hidden;
}

.record-home,
.record-quote {
  color: rgba(82, 56, 29, 0.68);
}

.record-status {
  color: rgba(128, 78, 22, 0.86);
}

.empty-state {
  width: min(420px, 80%);
  margin: 1.2rem auto 0;
  border-color: rgba(185, 126, 42, 0.34);
  color: #60401d;
  background: rgba(255, 244, 203, 0.82);
  box-shadow: inset 0 0 18px rgba(129, 82, 26, 0.08);
}

@media (max-width: 920px) {
  .content-shell {
    width: min(92%, 760px);
    margin-top: 1.2rem;
  }

  .directory-panel {
    min-height: auto;
  }

  .directory-panel::before {
    display: none;
  }

  .search-row {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .records-grid {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .book-page {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.8rem 0;
  }

  .record-card button {
    min-height: 280px;
  }
}

@media (max-width: 560px) {
  .content-shell {
    width: 94%;
  }

  .book-page {
    grid-template-columns: 1fr;
  }

  .record-card button {
    min-height: 230px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Effective final scroll and memorial tablet style */
.content-shell {
  width: min(86%, 1320px);
  margin: 5.1% auto 0;
}

.directory-panel {
  min-height: clamp(610px, 67vh, 705px);
  padding: clamp(1.1rem, 1.5vw, 1.55rem) clamp(4rem, 5.2vw, 5.8rem) clamp(1.45rem, 2vw, 2rem);
  overflow: visible;
  border-color: rgba(194, 134, 47, 0.58);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 238, 0.42), transparent 48%),
    linear-gradient(90deg, rgba(136, 88, 27, 0.17), transparent 8%, transparent 92%, rgba(136, 88, 27, 0.15)),
    repeating-linear-gradient(0deg, rgba(117, 78, 27, 0.04) 0 1px, transparent 1px 19px),
    linear-gradient(180deg, rgba(255, 250, 221, 0.96), rgba(255, 235, 181, 0.86));
}

.directory-panel::before,
.directory-panel::after {
  inset: auto;
  top: -0.72rem;
  bottom: -0.72rem;
  width: clamp(36px, 3.2vw, 48px);
  border: 1px solid rgba(143, 91, 28, 0.62);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 3%, #fff0a8 0 12%, #c38b36 13% 24%, transparent 25%),
    radial-gradient(circle at 50% 97%, #fff0a8 0 12%, #c38b36 13% 24%, transparent 25%),
    linear-gradient(90deg, #604122 0%, #bb832f 20%, #f2d389 45%, #8a5a23 70%, #3b2819 100%);
  box-shadow:
    inset 8px 0 14px rgba(255, 231, 143, 0.26),
    inset -10px 0 18px rgba(50, 28, 12, 0.36),
    0 0 22px rgba(255, 220, 126, 0.24),
    0 16px 34px rgba(0, 0, 0, 0.24);
  opacity: 1;
  transform: none;
  mix-blend-mode: normal;
  z-index: 3;
}

.directory-panel::before {
  left: clamp(0.4rem, 0.8vw, 0.8rem);
}

.directory-panel::after {
  right: clamp(0.4rem, 0.8vw, 0.8rem);
  left: auto;
}

.records-grid {
  min-height: clamp(410px, 47vh, 500px);
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: clamp(0.55rem, 0.86vw, 0.9rem);
  padding: 0.3rem 0.15rem 0.12rem;
  overflow: visible;
}

.book-page,
.book-page-left,
.book-page-right {
  display: contents;
}

.record-card {
  flex: 0 1 clamp(86px, 7.05vw, 104px);
  height: auto;
}

.record-card button {
  position: relative;
  min-height: clamp(400px, 45vh, 482px);
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  justify-items: center;
  align-items: start;
  gap: 0.32rem;
  padding: clamp(1.05rem, 1.25vw, 1.35rem) 0.38rem 0.58rem;
  border: 1px solid rgba(181, 122, 39, 0.58);
  border-radius: 44% 44% 8px 8px / 8% 8% 8px 8px;
  color: #4d3014;
  background:
    radial-gradient(ellipse at 50% 7%, rgba(255, 255, 247, 0.9), transparent 26%),
    linear-gradient(180deg, rgba(255, 252, 228, 0.96), rgba(255, 239, 188, 0.9) 68%, rgba(255, 229, 158, 0.9)),
    repeating-linear-gradient(90deg, rgba(111, 72, 25, 0.045) 0 1px, transparent 1px 18px);
  box-shadow:
    inset 0 0 0 4px rgba(255, 246, 209, 0.5),
    inset 0 0 18px rgba(121, 75, 20, 0.12),
    0 8px 16px rgba(87, 55, 19, 0.16),
    0 0 14px rgba(255, 222, 139, 0.22);
}

.record-card button::before {
  inset: 0.42rem;
  border: 1px solid rgba(172, 107, 29, 0.28);
  border-radius: 42% 42% 6px 6px / 8% 8% 6px 6px;
  background:
    linear-gradient(180deg, rgba(255, 248, 213, 0.18), transparent 35%),
    linear-gradient(90deg, rgba(156, 101, 28, 0.2), transparent 14%, transparent 86%, rgba(156, 101, 28, 0.18));
}

.record-card button::after {
  content: "";
  position: absolute;
  left: 19%;
  right: 19%;
  top: 0.58rem;
  height: 0.34rem;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(198, 137, 41, 0.7), rgba(255, 238, 167, 0.95), rgba(198, 137, 41, 0.7), transparent);
  box-shadow: 0 0 9px rgba(255, 222, 139, 0.62);
  pointer-events: none;
}

.record-card .record-name,
.record-card-kicker,
.record-relation,
.record-home,
.record-quote,
.record-status {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.record-card .record-name {
  min-height: 4.5em;
  margin: 0.05rem 0 0;
  color: #4b2e12;
  font-size: clamp(1.55rem, 1.82vw, 2rem);
  line-height: 1.02;
  letter-spacing: 0.14em;
}

.record-card-kicker,
.record-relation,
.record-status {
  max-height: 6.8em;
  overflow: hidden;
  color: rgba(126, 79, 23, 0.78);
  font-size: clamp(0.68rem, 0.75vw, 0.8rem);
  line-height: 1.16;
}

.record-home,
.record-quote {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.incense-image {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  width: min(92%, 86px);
  max-height: 82px;
  align-self: end;
  object-fit: contain;
  object-position: center bottom;
  filter:
    saturate(0.98)
    drop-shadow(0 5px 8px rgba(83, 49, 15, 0.24));
  pointer-events: none;
}

@media (max-width: 920px) {
  .directory-panel {
    padding-inline: 1.1rem;
  }

  .directory-panel::before,
  .directory-panel::after {
    display: none;
  }

  .records-grid {
    flex-wrap: wrap;
  }

  .record-card {
    flex-basis: clamp(86px, 18vw, 112px);
  }

  .record-card button {
    min-height: 310px;
  }
}

@media (max-width: 560px) {
  .record-card {
    flex-basis: min(30vw, 116px);
  }

  .record-card button {
    min-height: 270px;
  }

  .incense-image {
    max-height: 68px;
  }
}

/* Provided scroll image final override */
.content-shell {
  width: min(88%, 1360px);
  margin: 5.1% auto 0;
}

.directory-panel {
  aspect-ratio: 4261 / 2146;
  min-height: 0;
  padding: clamp(1.25rem, 2vw, 2rem) clamp(7rem, 9.7vw, 9.4rem) clamp(1.8rem, 2.8vw, 2.8rem);
  border: 0;
  border-radius: 0;
  background: url("./images/hjz001.webp") center / 100% 100% no-repeat;
  box-shadow:
    0 22px 62px rgba(5, 21, 30, 0.32),
    0 0 28px rgba(255, 222, 126, 0.16);
  backdrop-filter: none;
}

.directory-panel::before,
.directory-panel::after {
  display: none;
}

.search-row {
  width: min(93%, 1040px);
  margin-bottom: 0.64rem;
}

.filter-tabs {
  margin-bottom: 0.9rem;
}

.records-grid {
  min-height: clamp(360px, 40vh, 430px);
  align-items: stretch;
  gap: clamp(0.48rem, 0.75vw, 0.82rem);
  padding-top: 0.18rem;
}

.record-card {
  flex-basis: clamp(78px, 6.5vw, 96px);
}

.record-card button {
  min-height: clamp(345px, 38vh, 410px);
}

.incense-image {
  width: min(90%, 76px);
  max-height: 70px;
}

@media (max-width: 920px) {
  .directory-panel {
    aspect-ratio: auto;
    padding: 1.2rem;
    background:
      linear-gradient(180deg, rgba(255, 242, 184, 0.94), rgba(255, 211, 88, 0.86));
    border: 1px solid rgba(194, 134, 47, 0.46);
    border-radius: 8px;
  }

  .records-grid {
    min-height: 0;
  }
}

/* Final jade tablet artwork override after scroll image */
.records-grid {
  gap: clamp(0.44rem, 0.68vw, 0.74rem);
}

.record-card {
  flex: 0 1 clamp(88px, 6.65vw, 106px);
}

.record-card button {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(300px, 35.5vh, 362px);
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #3f2b16;
  background: url("./images/web/tablet-paiwei.webp") center top / contain no-repeat;
  box-shadow: none;
  overflow: visible;
}

.record-card button::before,
.record-card button::after {
  display: none;
}

.record-card button:hover,
.record-card button:focus-visible {
  transform: translateY(-5px);
  filter:
    drop-shadow(0 0 14px rgba(143, 224, 195, 0.45))
    drop-shadow(0 12px 18px rgba(32, 63, 54, 0.22));
  background: url("./images/web/tablet-paiwei.webp") center top / contain no-repeat;
  box-shadow: none;
}

.record-card-kicker,
.record-card .record-name,
.record-relation,
.record-status {
  position: absolute;
  z-index: 2;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  margin: 0;
  text-shadow:
    0 1px 0 rgba(246, 255, 238, 0.72),
    0 0 8px rgba(227, 255, 238, 0.42);
}

.record-card-kicker {
  top: 24%;
  right: 19%;
  max-height: 7em;
  color: rgba(67, 86, 57, 0.76);
  font-size: clamp(0.64rem, 0.68vw, 0.74rem);
  line-height: 1.08;
}

.record-card .record-name {
  top: 25%;
  left: 50%;
  min-height: 4.4em;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.96);
  text-shadow:
    0 1px 2px rgba(22, 64, 54, 0.66),
    0 0 8px rgba(255, 255, 255, 0.48),
    0 0 16px rgba(143, 224, 195, 0.36);
  font-size: clamp(1.28rem, 1.46vw, 1.62rem);
  line-height: 1.02;
  letter-spacing: 0.16em;
}

.record-relation {
  top: 25%;
  left: 19%;
  max-height: 4.5em;
  color: rgba(72, 62, 38, 0.72);
  font-size: clamp(0.66rem, 0.7vw, 0.76rem);
  line-height: 1.08;
}

.record-status {
  right: 20%;
  bottom: 25%;
  max-height: 6.2em;
  color: rgba(81, 72, 39, 0.78);
  font-size: clamp(0.62rem, 0.66vw, 0.72rem);
  line-height: 1.08;
}

.record-home,
.record-quote {
  display: none;
}

.incense-image {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 7%;
  width: min(68%, 70px);
  max-height: 58px;
  transform: translateX(-50%);
  object-fit: contain;
  object-position: center bottom;
  filter:
    saturate(0.98)
    drop-shadow(0 5px 8px rgba(39, 67, 56, 0.24));
}

@media (max-width: 920px) {
  .record-card {
    flex-basis: clamp(96px, 20vw, 122px);
  }

  .record-card button {
    height: clamp(318px, 52vw, 392px);
  }
}

@media (max-width: 560px) {
  .record-card {
    flex-basis: min(30vw, 116px);
  }

  .record-card button {
    height: clamp(286px, 86vw, 360px);
  }

  .incense-image {
    max-height: 52px;
  }
}
