/* =========================================================
   西游妖怪图录 · 玄绢、金线与朱砂
   ========================================================= */

@font-face {
  font-family: "Noto Serif SC";
  src: url("../assets/fonts/noto-serif-sc-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Noto Serif SC";
  src: url("../assets/fonts/noto-serif-sc-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Noto Serif SC";
  src: url("../assets/fonts/noto-serif-sc-900.woff2") format("woff2");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

/* 地点题名与朱砂印专用补字：覆盖全部 51 妖的题名用字 */
@font-face {
  font-family: "Noto Serif SC Locations";
  src: url("../assets/fonts/noto-serif-sc-locations-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #100e0b;
  --paper-deep: #0a0907;
  --paper-light: #eee3cd;
  --ink: #e9dfcb;
  --ink-soft: #c7baa2;
  --muted: #998a71;
  --muted-light: #746957;
  --red: #b44a3c;
  --red-dark: #7a2922;
  --gold: #b08b51;
  --line: rgba(198, 164, 105, 0.17);
  --line-strong: rgba(198, 164, 105, 0.38);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "Source Han Serif SC", "SimSun", serif;
  --sans: var(--serif);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --page: min(1320px, calc(100vw - 96px));
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 18% -6%, rgba(119, 72, 45, 0.28), transparent 37%),
    radial-gradient(ellipse at 88% 10%, rgba(98, 72, 39, 0.18), transparent 34%),
    radial-gradient(ellipse at 52% 82%, rgba(92, 39, 29, 0.12), transparent 45%),
    linear-gradient(112deg, rgba(198, 164, 105, 0.035), transparent 35%, rgba(198, 164, 105, 0.025) 70%, transparent);
  font-family: var(--serif);
  font-weight: 400;
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before,
body::after {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
  z-index: 20;
  pointer-events: none;
}

body::before {
  left: 27px;
}

body::after {
  right: 27px;
}

body.is-locked {
  overflow: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

img,
svg {
  display: block;
}

::selection {
  color: var(--paper-light);
  background: var(--red);
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}

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

.skip-link {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 2000;
  padding: 10px 18px;
  color: var(--paper-light);
  background: var(--ink);
  border: 1px solid var(--ink);
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  transform: translate(-50%, -160%);
  transition: transform 0.25s var(--ease);
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1500;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------
   Masthead
   --------------------------------------------------------- */

.masthead {
  position: relative;
  overflow: hidden;
  padding-top: 30px;
}

.masthead-inner,
.masthead-rail,
.locality-strip,
main,
.site-footer {
  width: var(--page);
  margin-inline: auto;
}

.masthead-rail {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0 12px;
  border-top: 1px solid var(--line-strong);
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  color: var(--muted);
}

.masthead-rail span:nth-child(2) {
  margin-left: auto;
}

.masthead-rail span:nth-child(3) {
  color: var(--red);
}

.masthead-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 228px;
  align-items: end;
  gap: 60px;
  padding: 56px 0 40px;
}

.title-block {
  position: relative;
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 22px;
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.23em;
  color: var(--muted);
  animation: softUp 0.9s var(--ease) both;
}

.eyebrow-line {
  width: 36px;
  height: 1px;
  background: var(--red);
  flex: 0 0 auto;
}

.main-title {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  margin: 0;
  font-size: clamp(3.1rem, 9vw, 8.4rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.title-char {
  display: inline-block;
  animation: characterRise 1s var(--ease) both;
}

.title-char:nth-child(1) { animation-delay: 0.04s; }
.title-char:nth-child(2) { animation-delay: 0.08s; }
.title-char:nth-child(3) { animation-delay: 0.12s; }
.title-char:nth-child(4) { animation-delay: 0.16s; }
.title-char:nth-child(5) { animation-delay: 0.20s; }
.title-char:nth-child(6) { animation-delay: 0.24s; }

.title-char--red {
  position: relative;
  color: var(--red);
}

.title-char--red::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -0.035em;
  height: 0.035em;
  background: currentColor;
  opacity: 0.5;
}

.lede {
  max-width: 38em;
  margin: 28px 0 0;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 2;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  animation: softUp 0.9s 0.3s var(--ease) both;
}

.lede-break {
  display: none;
}

.title-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 30px;
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  animation: softUp 0.9s 0.4s var(--ease) both;
}

.meta-dot {
  width: 3px;
  height: 3px;
  background: var(--red);
  transform: rotate(45deg);
  opacity: 0.7;
}

.style-note {
  margin: 18px 0 0;
  font-size: 0.7rem;
  line-height: 1.8;
  letter-spacing: 0.12em;
  color: #8f8069;
  animation: softUp 0.9s 0.46s var(--ease) both;
}

.masthead-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 0 6px 30px;
  border-left: 1px solid var(--line-strong);
  animation: softUp 0.9s 0.36s var(--ease) both;
}

.aside-rule {
  width: 36px;
  height: 4px;
  margin-bottom: 19px;
  background: var(--red);
}

.aside-kicker {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.64rem;
  letter-spacing: 0.28em;
  color: var(--muted);
}

.aside-count {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 7px;
  color: var(--red);
  line-height: 1;
}

.aside-count span {
  font-size: clamp(3.6rem, 5vw, 5.1rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  font-variant-numeric: lining-nums tabular-nums;
}

.aside-count small {
  padding-top: 7px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}

.aside-range {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.7;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.seal-pair {
  display: flex;
  gap: 7px;
  margin-top: 23px;
}

.seal {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--paper-light);
  background: var(--red);
  border: 1px solid var(--red-dark);
  font-size: 1.18rem;
  line-height: 1;
  box-shadow: inset 0 0 0 3px var(--red), inset 0 0 0 4px rgba(247, 238, 222, 0.68);
  transform: rotate(-2deg);
}

.seal--outline {
  color: var(--red);
  background: transparent;
  border-color: var(--red);
  box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px rgba(157, 53, 44, 0.3);
  transform: rotate(2deg);
}

.ink-watermark {
  position: absolute;
  top: -116px;
  right: -16px;
  z-index: 0;
  font-family: var(--serif);
  font-size: clamp(24rem, 38vw, 38rem);
  font-weight: 700;
  line-height: 1;
  color: rgba(62, 51, 34, 0.035);
  transform: rotate(-7deg);
  user-select: none;
  pointer-events: none;
}

.locality-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  padding: 15px 0 17px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line-strong);
  overflow: hidden;
  font-family: var(--sans);
  font-size: 0.64rem;
  letter-spacing: 0.23em;
  color: var(--muted);
  white-space: nowrap;
}

.locality-strip i {
  width: 14px;
  height: 1px;
  background: var(--line-strong);
  flex: 1 1 auto;
}

/* ---------------------------------------------------------
   Chapter filter
   --------------------------------------------------------- */

main {
  position: relative;
  z-index: 1;
}

.filter-section {
  padding: 64px 0 28px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 24px;
}

.section-title-wrap {
  position: relative;
  padding-left: 22px;
}

.section-title-wrap::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 4px;
  width: 3px;
  background: var(--red);
}

.section-kicker {
  margin: 0 0 7px;
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  color: var(--muted);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3.2vw, 2.8rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: 0.12em;
}

.section-note {
  margin: 0 0 5px;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.chapter-tab[data-filter="all"] {
  grid-column: span 2;
}

.chapter-tab {
  --tab-accent: var(--red);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100px;
  padding: 13px 13px 12px;
  overflow: hidden;
  color: var(--ink);
  background: rgba(249, 244, 234, 0.3);
  border: 1px solid var(--line);
  border-radius: 2px;
  text-align: left;
  cursor: pointer;
  transition:
    color 0.35s var(--ease),
    background 0.35s var(--ease),
    border-color 0.35s var(--ease),
    transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}

.chapter-tab::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--tab-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.chapter-tab::after {
  content: "";
  position: absolute;
  right: -13px;
  bottom: -13px;
  width: 31px;
  height: 31px;
  border: 1px solid var(--line);
  transform: rotate(45deg);
  transition: border-color 0.35s var(--ease);
}

.chapter-tab:hover {
  z-index: 2;
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(48, 38, 24, 0.07);
}

.chapter-tab:hover::before {
  transform: scaleX(1);
}

.chapter-tab.is-active {
  color: var(--paper-light);
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 4px 4px 0 rgba(157, 53, 44, 0.18);
}

.chapter-tab.is-active::before {
  background: var(--red);
  transform: scaleX(1);
}

.chapter-tab.is-active::after {
  border-color: rgba(244, 235, 219, 0.3);
}

.chapter-tab:focus-visible {
  outline-offset: 2px;
}

.tab-chapter {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--sans);
  font-size: clamp(1.05rem, 1.35vw, 1.38rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
}

.tab-chapter em {
  font-style: normal;
  font-size: 0.56em;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: color 0.35s var(--ease);
}

.chapter-tab.is-active .tab-chapter em {
  color: rgba(244, 235, 219, 0.58);
}

.tab-label {
  display: block;
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 0.67rem;
  line-height: 1.5;
  letter-spacing: 0.09em;
  color: var(--muted);
  transition: color 0.35s var(--ease);
}

.chapter-tab.is-active .tab-label {
  color: rgba(244, 235, 219, 0.64);
}

.tab-all-mark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--sans);
}

.tab-all-mark span:first-child {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.tab-all-mark span:last-child {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  transition: color 0.35s var(--ease);
}

.chapter-tab.is-active .tab-all-mark span:last-child {
  color: rgba(244, 235, 219, 0.62);
}

.filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  gap: 20px;
  padding-top: 14px;
}

.filter-status {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.filter-status strong {
  color: var(--red);
  font-weight: 600;
}

/* ---------------------------------------------------------
   Catalog cards
   --------------------------------------------------------- */

.catalog {
  padding: 36px 0 108px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 44px 27px;
}

.monster-card {
  --accent: var(--red);
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  animation: cardReveal 0.7s var(--ease) both;
  animation-delay: var(--delay, 0s);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 0 11px;
  border-top: 1px solid var(--line-strong);
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  transition: border-color 0.4s var(--ease);
}

.card-topline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.55s var(--ease);
}

.card-chapter {
  color: var(--accent);
  font-weight: 500;
}

.card-index {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.card-index::before {
  content: "";
  width: 3px;
  height: 3px;
  background: currentColor;
  transform: rotate(45deg);
  opacity: 0.65;
}

.card-art {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 250, 239, 0.36), transparent 50%),
    var(--paper-deep);
  border: 1px solid rgba(42, 35, 25, 0.24);
  box-shadow: 0 1px 0 rgba(255, 253, 247, 0.65);
}

.card-art::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 2;
  border: 1px solid rgba(247, 239, 223, 0.16);
  pointer-events: none;
  transition: border-color 0.5s var(--ease);
}

.card-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(180deg, rgba(20, 17, 12, 0.11), transparent 17%, transparent 70%, rgba(20, 17, 12, 0.17)),
    linear-gradient(90deg, rgba(20, 17, 12, 0.08), transparent 12%, transparent 88%, rgba(20, 17, 12, 0.08));
  pointer-events: none;
}

.card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.93) contrast(1.015);
  transform: scale(1.001);
  transition:
    transform 1s var(--ease),
    filter 0.7s var(--ease);
}

.art-inscription {
  position: absolute;
  top: 21px;
  left: 18px;
  z-index: 4;
  padding-left: 5px;
  writing-mode: vertical-rl;
  color: rgba(231, 213, 180, 0.8);
  border-left: 1px solid rgba(198, 164, 105, 0.35);
  font-family: "Noto Serif SC Locations", var(--serif);
  font-weight: 400;
  font-synthesis: none;
  font-size: 0.59rem;
  line-height: 1;
  letter-spacing: 0.28em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.art-seal {
  position: absolute;
  right: 17px;
  bottom: 18px;
  z-index: 4;
  display: grid;
  grid-template-rows: 1fr 1fr;
  place-items: center;
  width: 33px;
  height: 42px;
  color: #f1e4ce;
  background: #8e3027;
  border: 1px solid rgba(214, 177, 113, 0.8);
  box-shadow: inset 0 0 0 2px #8e3027, inset 0 0 0 3px rgba(241, 228, 206, 0.45), 0 2px 8px rgba(0, 0, 0, 0.28);
  font-family: "Noto Serif SC Locations", var(--serif);
  font-size: 0.68rem;
  line-height: 1;
  transform: rotate(-2deg);
  pointer-events: none;
}

.art-seal b {
  font-weight: 600;
  letter-spacing: 0.05em;
}

.card-caption {
  padding: 17px 1px 0;
}

.card-name {
  display: block;
  margin: 0;
  font-size: clamp(1.5rem, 2.15vw, 1.98rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.06em;
  transition: color 0.35s var(--ease);
}

.card-subrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.card-subrow::before {
  content: "";
  width: 15px;
  height: 1px;
  background: var(--accent);
  opacity: 0.75;
  flex: 0 0 auto;
}

.card-alias {
  margin: 0;
  white-space: nowrap;
}

.card-kind {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-light);
  white-space: nowrap;
}

.card-kind::before {
  content: "";
  width: 2px;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px dotted rgba(42, 35, 25, 0.22);
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.11em;
  color: var(--muted);
}

.card-location {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-location svg {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
}

.card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: color 0.35s var(--ease);
}

.card-arrow span {
  transition: transform 0.35s var(--ease);
}

.monster-card:hover .card-name,
.monster-card:focus-visible .card-name {
  color: var(--red);
}

.monster-card:hover .card-topline,
.monster-card:focus-visible .card-topline {
  border-color: transparent;
}

.monster-card:hover .card-topline::before,
.monster-card:focus-visible .card-topline::before {
  transform: scaleX(1);
}

.monster-card:hover .card-art img,
.monster-card:focus-visible .card-art img {
  transform: scale(1.035);
  filter: saturate(1.03) contrast(1.035);
}

.monster-card:hover .card-art::before,
.monster-card:focus-visible .card-art::before {
  border-color: rgba(247, 239, 223, 0.35);
}

.monster-card:hover .card-arrow,
.monster-card:focus-visible .card-arrow {
  color: var(--red);
}

.monster-card:hover .card-arrow span,
.monster-card:focus-visible .card-arrow span {
  transform: translateX(5px);
}

.monster-card:focus-visible {
  outline-offset: 8px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 340px;
  padding: 60px 20px;
  text-align: center;
  border: 1px solid var(--line);
  background: rgba(248, 242, 232, 0.32);
}

.empty-state[hidden] {
  display: none;
}

.empty-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  color: var(--red);
  border: 1px solid var(--red);
  font-size: 1.8rem;
  transform: rotate(-3deg);
}

.empty-state p {
  margin: 22px 0 18px;
  font-size: 1.1rem;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.empty-state button {
  padding: 8px 0 4px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.empty-state button:hover {
  color: var(--red);
  border-color: var(--red);
}

/* Last card centers itself when the collection leaves an empty pair of slots */

@media (min-width: 981px) {
  .catalog-grid > .monster-card:last-child:nth-child(7) {
    grid-column: 2;
  }
}

/* Filtered chapter view */

.catalog.is-filtered {
  display: grid;
  grid-template-columns: minmax(270px, 0.66fr) minmax(0, 1.34fr);
  align-items: stretch;
  gap: clamp(24px, 4vw, 54px);
}

.catalog.is-filtered .catalog-grid {
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
  width: 100%;
}

.chapter-feature {
  --accent: var(--red);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 25px 27px 28px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 252, 245, 0.7), rgba(231, 222, 204, 0.42)),
    var(--paper-deep);
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--accent);
  box-shadow: 7px 7px 0 rgba(42, 35, 25, 0.045);
  animation: featureReveal 0.7s var(--ease) both;
}

.chapter-feature::before {
  content: "";
  position: absolute;
  top: 26px;
  right: 24px;
  width: 60px;
  height: 60px;
  border: 1px solid var(--line);
  transform: rotate(45deg);
  pointer-events: none;
}

.chapter-feature::after {
  content: "回";
  position: absolute;
  right: -16px;
  bottom: -70px;
  color: rgba(42, 35, 25, 0.038);
  font-size: 14rem;
  line-height: 1;
  pointer-events: none;
}

.feature-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.feature-head span:last-child {
  color: var(--accent);
}

.feature-number {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  margin-top: 17px;
  color: var(--ink);
  line-height: 0.82;
  font-variant-numeric: lining-nums tabular-nums;
}

.feature-number span {
  font-size: clamp(4.3rem, 7.2vw, 6.7rem);
  font-weight: 400;
  letter-spacing: -0.06em;
}

.feature-number small {
  padding-bottom: 8px;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.feature-place {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 19px 0 8px;
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.feature-place::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}

.chapter-feature h2 {
  max-width: 12em;
  margin: 0;
  font-size: clamp(1.35rem, 2.15vw, 1.85rem);
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.06em;
}

.feature-summary {
  margin: 16px 0 0;
  font-size: 0.82rem;
  line-height: 1.9;
  letter-spacing: 0.035em;
  color: var(--ink-soft);
}

.feature-powers {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 17px;
}

.feature-powers span {
  margin-right: 3px;
  font-family: var(--sans);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.feature-powers em {
  padding: 4px 8px 5px;
  border: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.62rem;
  font-style: normal;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

.feature-quote {
  margin: 22px 0 0;
  padding: 14px 0 0 15px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--accent);
}

.feature-quote blockquote {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.75;
  letter-spacing: 0.05em;
  color: var(--ink);
}

.feature-quote figcaption {
  margin-top: 7px;
  font-family: var(--sans);
  font-size: 0.57rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.feature-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
}

.feature-footer span {
  font-family: var(--sans);
  font-size: 0.61rem;
  letter-spacing: 0.13em;
  color: var(--muted);
}

.feature-footer strong {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
}

@keyframes featureReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------------------------------------------------------
   Dossier dialog
   --------------------------------------------------------- */

.dossier {
  width: min(1130px, calc(100vw - 56px));
  max-width: none;
  max-height: 90vh;
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper-light);
  border: 0;
  box-shadow:
    0 35px 90px rgba(15, 12, 8, 0.38),
    0 0 0 1px rgba(42, 35, 25, 0.5);
}

.dossier[open] {
  animation: dossierIn 0.48s var(--ease) both;
}

.dossier::backdrop {
  background: rgba(23, 19, 14, 0.7);
  backdrop-filter: blur(6px) saturate(0.8);
  animation: backdropIn 0.35s ease both;
}

.dossier-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  height: min(88vh, 900px);
  overflow: hidden;
}

.dossier-visual {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #1b1712;
}

.dossier-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 14, 10, 0.14), transparent 18%, transparent 66%, rgba(18, 14, 10, 0.62)),
    linear-gradient(90deg, transparent 84%, rgba(18, 14, 10, 0.18));
  pointer-events: none;
}

.dossier-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dossier-visual-caption {
  position: absolute;
  left: 27px;
  right: 27px;
  bottom: 24px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  color: rgba(247, 239, 224, 0.88);
  border-top: 1px solid rgba(247, 239, 224, 0.35);
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
}

.dossier-visual-caption span:first-child {
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: 0.08em;
}

.dossier-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--ink);
  background: rgba(247, 239, 224, 0.92);
  border: 1px solid rgba(42, 35, 25, 0.24);
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: color 0.25s, background 0.25s, transform 0.35s var(--ease);
}

.dossier-close:hover {
  color: var(--paper-light);
  background: var(--red);
  transform: rotate(90deg);
}

.dossier-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.dossier-content {
  min-width: 0;
  overflow-y: auto;
  padding: 52px 55px 58px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.dossier-content::-webkit-scrollbar {
  width: 8px;
}

.dossier-content::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 2px solid var(--paper-light);
}

.dossier-eyebrow {
  margin: 0 0 13px;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--red);
}

.dossier-content h2 {
  margin: 0;
  font-size: clamp(2.5rem, 4.6vw, 4.3rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: 0.04em;
  word-break: keep-all;
  overflow-wrap: normal;
}

.dossier-content h2.is-long {
  font-size: clamp(2rem, 3.35vw, 3.15rem);
  line-height: 1.18;
}

.dossier-alias {
  margin: 10px 0 0;
  font-family: var(--sans);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.dossier-summary {
  margin: 25px 0 0;
  padding-top: 21px;
  border-top: 1px solid var(--line-strong);
  font-size: 0.98rem;
  line-height: 1.95;
  letter-spacing: 0.045em;
  color: var(--ink-soft);
}

.dossier-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 25px 0 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.dossier-facts > div {
  padding: 12px 14px 13px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dossier-facts dt {
  margin-bottom: 5px;
  font-family: var(--sans);
  font-size: 0.61rem;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.dossier-facts dd {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.dossier-section {
  margin-top: 27px;
}

.dossier-section h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-family: var(--sans);
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--red);
}

.dossier-section h3::after {
  content: "";
  width: 38px;
  height: 1px;
  background: var(--red);
  opacity: 0.45;
}

.dossier-section p {
  margin: 0;
  font-size: 0.91rem;
  line-height: 1.95;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.power-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.power-list li {
  padding: 5px 11px 6px;
  color: var(--ink-soft);
  background: rgba(42, 35, 25, 0.035);
  border: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
}

.dossier-section--fate {
  padding: 15px 17px 16px;
  border-left: 3px solid var(--ink);
  background: rgba(42, 35, 25, 0.035);
}

.dossier-section--fate h3 {
  margin-bottom: 7px;
  color: var(--ink);
}

.dossier-section--fate h3::after {
  background: var(--ink);
}

.dossier-quote {
  position: relative;
  margin: 31px 0 0;
  padding: 23px 0 0 28px;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--red);
}

.dossier-quote::before {
  content: "“";
  position: absolute;
  top: 12px;
  left: 9px;
  font-family: Georgia, serif;
  font-size: 3.2rem;
  line-height: 1;
  color: var(--red);
  opacity: 0.35;
}

.dossier-quote blockquote {
  margin: 0;
  font-size: clamp(1.08rem, 1.45vw, 1.26rem);
  line-height: 1.8;
  letter-spacing: 0.07em;
  color: var(--ink);
}

.dossier-quote figcaption {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.site-footer {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 30px 0 48px;
  border-top: 1px solid var(--line-strong);
}

.footer-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  color: var(--paper-light);
  background: var(--red);
  font-size: 1.3rem;
  box-shadow: inset 0 0 0 3px var(--red), inset 0 0 0 4px rgba(247, 238, 222, 0.7);
  transform: rotate(-2deg);
}

.footer-copy {
  max-width: 700px;
}

.footer-copy p {
  margin: 2px 0 0;
  font-size: 0.78rem;
  line-height: 1.8;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.footer-copy .footer-small {
  margin-top: 7px;
  font-family: var(--sans);
  font-size: 0.61rem;
  letter-spacing: 0.13em;
  color: var(--muted-light);
}

.back-top {
  margin-left: auto;
  padding-bottom: 4px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s, border-color 0.25s;
}

.back-top span {
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.25s;
}

.back-top:hover {
  color: var(--red);
  border-color: var(--red);
}

.back-top:hover span {
  transform: translateY(-3px);
}

.noscript {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 2000;
  max-width: calc(100vw - 40px);
  margin: 0;
  padding: 12px 18px;
  color: var(--paper-light);
  background: var(--red-dark);
  font-family: var(--sans);
  font-size: 0.8rem;
  transform: translateX(-50%);
}

/* ---------------------------------------------------------
   Motion
   --------------------------------------------------------- */

@keyframes characterRise {
  from {
    opacity: 0;
    transform: translateY(0.3em) rotate(1.5deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}

@keyframes softUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dossierIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 1220px) {
  :root {
    --page: min(1320px, calc(100vw - 72px));
  }

  .masthead-inner {
    grid-template-columns: minmax(0, 1fr) 205px;
    gap: 40px;
  }

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

  .chapter-tab {
    min-height: 92px;
  }

  .catalog-grid {
    gap: 40px 23px;
  }

  .dossier-content {
    padding: 44px 42px 50px;
  }
}

@media (max-width: 980px) {
  :root {
    --page: calc(100vw - 56px);
  }

  body::before,
  body::after {
    display: none;
  }

  .masthead-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 44px 0 32px;
  }

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

  .masthead-aside {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 12px 22px;
    padding: 18px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .aside-rule,
  .aside-kicker {
    display: none;
  }

  .aside-count {
    margin: 0;
  }

  .aside-count span {
    font-size: 2.8rem;
  }

  .aside-range {
    line-height: 1.6;
  }

  .seal-pair {
    margin-top: 0;
    justify-self: end;
  }

  .ink-watermark {
    top: -64px;
    right: -30px;
    font-size: 28rem;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .section-heading h2 {
    font-size: 2.2rem;
  }

  .section-note {
    padding-left: 22px;
  }

  .filter-section {
    padding-top: 48px;
  }

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

  .dossier {
    width: calc(100vw - 40px);
  }

  .dossier-shell {
    grid-template-columns: minmax(0, 0.74fr) minmax(0, 1.26fr);
  }

  .dossier-content {
    padding: 42px 32px 48px;
  }

  .dossier-facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --page: calc(100vw - 38px);
  }

  .masthead {
    padding-top: 20px;
  }

  .masthead-rail {
    font-size: 0.58rem;
    letter-spacing: 0.17em;
  }

  .masthead-rail span:nth-child(2) {
    display: none;
  }

  .main-title {
    font-size: clamp(2.75rem, 12.3vw, 5.2rem);
    letter-spacing: 0.005em;
  }

  .eyebrow {
    font-size: 0.54rem;
    letter-spacing: 0.16em;
    margin-bottom: 17px;
  }

  .eyebrow-line {
    width: 24px;
  }

  .lede {
    margin-top: 22px;
    font-size: 0.95rem;
    line-height: 1.9;
  }

  .lede-break {
    display: block;
  }

  .title-meta {
    gap: 8px;
    font-size: 0.58rem;
    letter-spacing: 0.1em;
  }

  .masthead-aside {
    grid-template-columns: auto 1fr auto;
  }

  .aside-range {
    font-size: 0.72rem;
  }

  .seal-pair {
    gap: 5px;
  }

  .seal {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .locality-strip {
    gap: 9px;
    font-size: 0.56rem;
    letter-spacing: 0.16em;
    padding: 12px 0 13px;
  }

  .locality-strip span:nth-of-type(even) {
    display: none;
  }

  .locality-strip i {
    flex: 1 1 8px;
  }

  .filter-section {
    padding: 40px 0 18px;
  }

  .section-heading {
    margin-bottom: 18px;
  }

  .section-heading h2 {
    font-size: 1.85rem;
  }

  .section-note {
    font-size: 0.78rem;
  }

  .chapter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .chapter-tab {
    min-height: 80px;
    padding: 11px 11px 10px;
  }

  .tab-chapter {
    font-size: 1.05rem;
  }

  .tab-label {
    font-size: 0.61rem;
  }

  .filter-footer {
    min-height: 34px;
    padding-top: 10px;
  }

  .filter-status {
    font-size: 0.7rem;
  }

  .catalog {
    padding: 26px 0 72px;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
    max-width: 510px;
    margin: 0 auto;
    gap: 35px;
  }

  .catalog.is-filtered {
    display: block;
  }

  .catalog.is-filtered .catalog-grid {
    max-width: 510px;
    margin: 31px auto 0;
  }

  .chapter-feature {
    padding: 21px 22px 23px;
  }

  .chapter-feature::before {
    width: 48px;
    height: 48px;
  }

  .feature-number span {
    font-size: 4.7rem;
  }

  .chapter-feature h2 {
    max-width: none;
    font-size: 1.45rem;
  }

  .feature-summary {
    font-size: 0.79rem;
  }

  .card-name {
    font-size: 1.82rem;
  }

  .dossier {
    width: 100vw;
    max-height: 100dvh;
    margin: auto 0 0;
  }

  .dossier[open] {
    animation: dossierMobileIn 0.45s var(--ease) both;
  }

  .dossier-shell {
    display: block;
    height: auto;
    max-height: 100dvh;
    overflow-y: auto;
  }

  .dossier-visual {
    height: 38dvh;
    min-height: 270px;
  }

  .dossier-visual img {
    object-position: center 28%;
  }

  .dossier-content {
    overflow: visible;
    padding: 29px 23px 46px;
  }

  .dossier-content h2 {
    font-size: 2.45rem;
  }

  .dossier-close {
    position: fixed;
    top: 13px;
    right: 13px;
    width: 38px;
    height: 38px;
  }

  .dossier-facts {
    grid-template-columns: 1fr 1fr;
  }

  .dossier-summary {
    font-size: 0.92rem;
  }

  .site-footer {
    flex-wrap: wrap;
    padding: 25px 0 38px;
  }

  .footer-copy {
    flex: 1 1 240px;
  }

  .back-top {
    margin-left: 67px;
  }
}

@media (max-width: 440px) {
  .title-meta span:nth-of-type(4),
  .title-meta span:nth-of-type(5) {
    display: none;
  }

  .masthead-aside {
    grid-template-columns: auto 1fr;
  }

  .seal-pair {
    display: none;
  }

  .chapter-tab {
    min-height: 76px;
  }

  .filter-footer {
    align-items: flex-start;
  }

  .dossier-facts {
    grid-template-columns: 1fr;
  }

  .dossier-section--fate {
    padding: 13px 14px;
  }
}

@keyframes dossierMobileIn {
  from {
    opacity: 0;
    transform: translateY(45px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------------------------------------------------------
   玄绢主题 · 暗底、金线、朱砂
   --------------------------------------------------------- */

::selection {
  color: #f3e7d0;
  background: var(--red);
}

.skip-link {
  color: #f3e7d0;
  background: #8e3027;
  border-color: #ba8152;
}

body::before,
body::after {
  background: rgba(198, 164, 105, 0.12);
}

.masthead {
  background:
    radial-gradient(ellipse at 78% 4%, rgba(137, 86, 48, 0.18), transparent 44%),
    linear-gradient(180deg, rgba(7, 6, 5, 0.25), transparent 85%);
}

.masthead-rail {
  border-top-color: var(--line-strong);
  color: #97886f;
}

.masthead-rail span:nth-child(3) {
  color: #c26a58;
}

.eyebrow {
  color: #ad9b7f;
}

.eyebrow-line {
  background: #b08b51;
}

.main-title {
  color: #ece1cb;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.28);
}

.title-char--red {
  color: #b84c3d;
}

.lede {
  color: #cbbda5;
}

.title-meta {
  color: #9d8c73;
}

.meta-dot {
  background: #b08b51;
}

.masthead-aside {
  border-left-color: var(--line-strong);
}

.aside-rule {
  background: #b08b51;
}

.aside-kicker {
  color: #a29177;
}

.aside-count span {
  color: #bb5a49;
}

.aside-count small,
.aside-range {
  color: #c3b49b;
}

.seal {
  color: #f2e6d0;
  background: #8e3027;
  border-color: #bd8d59;
  box-shadow: inset 0 0 0 3px #8e3027, inset 0 0 0 4px rgba(232, 207, 165, 0.72);
}

.seal--outline {
  color: #c49a5c;
  background: transparent;
  border-color: #a67c42;
  box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px rgba(176, 139, 81, 0.35);
}

.ink-watermark {
  color: rgba(176, 139, 81, 0.055);
}

.locality-strip {
  border-top-color: var(--line);
  border-bottom-color: var(--line-strong);
  color: #998a71;
}

.locality-strip i {
  background: rgba(198, 164, 105, 0.31);
}

.section-kicker {
  color: #a29074;
}

.section-title-wrap::before {
  background: #b08b51;
}

.section-heading h2 {
  color: #e9dfca;
}

.section-note {
  color: #9f9078;
}

.chapter-tab {
  color: #d9cdb7;
  background: rgba(18, 15, 11, 0.82);
  border-color: rgba(198, 164, 105, 0.2);
}

.chapter-tab::after {
  border-color: rgba(198, 164, 105, 0.18);
}

.chapter-tab:hover {
  border-color: rgba(198, 164, 105, 0.58);
  background: #19150f;
  box-shadow: 0 9px 26px rgba(0, 0, 0, 0.28);
}

.chapter-tab.is-active {
  color: #f3e7d0;
  background: #78271f;
  border-color: #b8884f;
  box-shadow: 4px 4px 0 rgba(180, 74, 60, 0.18);
}

.chapter-tab.is-active::before {
  background: #d0a768;
}

.chapter-tab.is-active::after {
  border-color: rgba(238, 225, 201, 0.28);
}

.tab-chapter em,
.tab-label,
.tab-all-mark span:last-child {
  color: #97886f;
}

.chapter-tab.is-active .tab-chapter em,
.chapter-tab.is-active .tab-label,
.chapter-tab.is-active .tab-all-mark span:last-child {
  color: rgba(243, 231, 208, 0.7);
}

.filter-status {
  color: #a4957c;
}

.filter-status strong {
  color: #c46955;
}

.catalog {
  position: relative;
}

.monster-card {
  padding: 13px 13px 16px;
  background:
    linear-gradient(145deg, rgba(255, 248, 231, 0.028), rgba(255, 248, 231, 0.006)),
    #13100c;
  border: 1px solid rgba(198, 164, 105, 0.17);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.16);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}

.monster-card:hover,
.monster-card:focus-visible {
  background:
    linear-gradient(145deg, rgba(255, 248, 231, 0.045), rgba(255, 248, 231, 0.012)),
    #17130e;
  border-color: rgba(198, 164, 105, 0.48);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.28);
  transform: translateY(-3px);
}

.card-topline {
  padding-top: 0;
  color: #938267;
  border-top-color: rgba(198, 164, 105, 0.28);
}

.card-topline::before {
  top: 0;
  background: #b08b51;
}

.card-chapter {
  color: #b99b67;
}

.card-name {
  color: #ece1cb;
}

.card-subrow {
  color: #a08f74;
}

.card-kind {
  color: #80725e;
}

.card-bottom {
  color: #97886f;
  border-top-color: rgba(198, 164, 105, 0.2);
}

.card-location svg {
  stroke: #b08b51;
}

.card-arrow {
  color: #b9a280;
}

.card-art {
  background: #090806;
  border-color: rgba(198, 164, 105, 0.24);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), 0 2px 20px rgba(0, 0, 0, 0.25);
}

.card-art::before {
  border-color: rgba(231, 211, 174, 0.11);
}

.card-art::after {
  background:
    linear-gradient(180deg, rgba(8, 7, 5, 0.2), transparent 16%, transparent 69%, rgba(8, 7, 5, 0.44)),
    linear-gradient(90deg, rgba(8, 7, 5, 0.14), transparent 12%, transparent 88%, rgba(8, 7, 5, 0.14));
}

.card-art img {
  filter: saturate(0.94) contrast(1.03) brightness(1.02);
}

.card-art-number {
  color: rgba(233, 219, 194, 0.82);
  border-color: rgba(233, 219, 194, 0.4);
}

.monster-card:hover .card-name,
.monster-card:focus-visible .card-name {
  color: #c96f58;
}

.monster-card:hover .card-arrow,
.monster-card:focus-visible .card-arrow {
  color: #cf9c5e;
}

.card-topline,
.card-art,
.card-caption {
  position: relative;
  z-index: 1;
}

.empty-state {
  background: rgba(255, 248, 231, 0.02);
  border-color: var(--line);
}

.empty-mark {
  color: #c16b55;
  border-color: #a54a3d;
}

.empty-state p,
.empty-state button {
  color: #b9aa91;
}

.chapter-feature {
  background:
    linear-gradient(145deg, rgba(255, 248, 231, 0.035), rgba(255, 248, 231, 0.008)),
    #13100c;
  border-color: rgba(198, 164, 105, 0.36);
  border-top-color: var(--accent);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.22);
}

.chapter-feature::before {
  border-color: rgba(198, 164, 105, 0.16);
}

.chapter-feature::after {
  color: rgba(198, 164, 105, 0.05);
}

.feature-head {
  color: #9d8c73;
  border-bottom-color: var(--line);
}

.feature-number {
  color: #ede2cc;
}

.feature-number small,
.feature-place {
  color: #ae9a7c;
}

.chapter-feature h2 {
  color: #e9dfca;
}

.feature-summary {
  color: #b7a98f;
}

.feature-powers span {
  color: #918169;
}

.feature-powers em {
  color: #cbbda5;
  background: rgba(255, 248, 231, 0.02);
  border-color: var(--line);
}

.feature-quote {
  border-top-color: var(--line);
  border-left-color: var(--accent);
}

.feature-quote blockquote {
  color: #e4d8c2;
}

.feature-quote figcaption,
.feature-footer span {
  color: #948267;
}

.feature-footer {
  border-top-color: var(--line-strong);
}

.feature-footer strong {
  color: #e9dfca;
}

/* 妖档 */

.dossier {
  color: #e9dfca;
  background: #12100c;
  border: 1px solid rgba(198, 164, 105, 0.5);
  box-shadow: 0 38px 100px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(0, 0, 0, 0.8);
}

.dossier::backdrop {
  background: rgba(7, 6, 5, 0.82);
  backdrop-filter: blur(8px) saturate(0.65);
}

.dossier-visual {
  background: #070605;
}

.dossier-visual::after {
  background:
    linear-gradient(180deg, rgba(5, 4, 3, 0.18), transparent 18%, transparent 66%, rgba(5, 4, 3, 0.72)),
    linear-gradient(90deg, transparent 84%, rgba(5, 4, 3, 0.25));
}

.dossier-visual-caption {
  color: rgba(238, 225, 201, 0.85);
  border-top-color: rgba(238, 225, 201, 0.3);
}

.dossier-close {
  color: #e4d6bd;
  background: rgba(24, 20, 14, 0.9);
  border-color: rgba(198, 164, 105, 0.48);
}

.dossier-close:hover {
  color: #f6ead4;
  background: #8e3027;
}

.dossier-content {
  scrollbar-color: rgba(198, 164, 105, 0.42) transparent;
}

.dossier-content::-webkit-scrollbar-thumb {
  background: rgba(198, 164, 105, 0.4);
  border-color: #12100c;
}

.dossier-eyebrow {
  color: #c66f59;
}

.dossier-content h2 {
  color: #ede2cc;
}

.dossier-alias {
  color: #9f8f75;
}

.dossier-summary {
  color: #c4b69d;
  border-top-color: var(--line-strong);
}

.dossier-facts {
  border-top-color: var(--line);
  border-left-color: var(--line);
}

.dossier-facts > div {
  border-right-color: var(--line);
  border-bottom-color: var(--line);
}

.dossier-facts dt {
  color: #97876e;
}

.dossier-facts dd {
  color: #ded2bb;
}

.dossier-section h3 {
  color: #c16a55;
}

.dossier-section h3::after {
  background: #a75443;
}

.dossier-section p {
  color: #c1b29a;
}

.power-list li {
  color: #cdbfa6;
  background: rgba(255, 248, 231, 0.025);
  border-color: var(--line);
}

.dossier-section--fate {
  background: rgba(255, 248, 231, 0.035);
  border-left-color: #b08b51;
}

.dossier-section--fate h3 {
  color: #d6c2a4;
}

.dossier-section--fate h3::after {
  background: #b08b51;
}

.dossier-quote {
  border-top-color: var(--line-strong);
  border-left-color: #a64a3d;
}

.dossier-quote::before {
  color: #b45544;
}

.dossier-quote blockquote {
  color: #ebdfc8;
}

.dossier-quote figcaption {
  color: #97876e;
}

/* 页脚 */

.site-footer {
  border-top-color: var(--line-strong);
}

.footer-mark {
  color: #f2e6d0;
  background: #8e3027;
  box-shadow: inset 0 0 0 3px #8e3027, inset 0 0 0 4px rgba(232, 207, 165, 0.7);
}

.footer-copy p {
  color: #9b8b72;
}

.footer-copy .footer-small {
  color: #786d5b;
}

.back-top {
  color: #bfae92;
  border-bottom-color: var(--line-strong);
}

.back-top:hover {
  color: #cd7a61;
  border-color: #b87858;
}

:focus-visible {
  outline-color: #d0a768;
}

.noscript {
  color: #f3e7d0;
  background: #7a2922;
}

/* 字体细节：统一宋体后重新校准字距 */

.masthead-rail,
.eyebrow,
.title-meta,
.locality-strip,
.section-kicker,
.tab-label,
.filter-status,
.card-subrow,
.card-bottom,
.dossier-eyebrow,
.dossier-facts dt,
.dossier-section h3,
.power-list li,
.dossier-quote figcaption,
.footer-copy .footer-small,
.back-top {
  font-family: var(--serif);
  font-weight: 400;
}

.eyebrow,
.section-kicker,
.dossier-eyebrow,
.dossier-section h3 {
  letter-spacing: 0.24em;
}

.masthead-rail {
  letter-spacing: 0.2em;
}

.title-meta,
.locality-strip,
.filter-status {
  letter-spacing: 0.15em;
}

.tab-label,
.card-subrow,
.card-bottom,
.dossier-facts dt,
.dossier-quote figcaption {
  letter-spacing: 0.1em;
}

.section-heading h2 {
  font-weight: 600;
  letter-spacing: 0.16em;
}

.main-title {
  font-weight: 800;
  letter-spacing: 0.025em;
}

.card-name {
  font-weight: 600;
  letter-spacing: 0.08em;
}

.dossier-content h2 {
  font-weight: 600;
}

.dossier-content h2.is-long {
  font-weight: 600;
}

@media (max-width: 760px) {
  .monster-card {
    padding: 10px 10px 14px;
  }

  .chapter-tab {
    background: rgba(18, 15, 11, 0.9);
  }

  .dossier-close {
    background: rgba(24, 20, 14, 0.92);
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}
