:root {
  color-scheme: light;
  --ink: #181512;
  --muted: #706960;
  --paper: #f7f3eb;
  --surface: #fffdf8;
  --line: #dfd4c5;
  --red: #b92f24;
  --blue: #245b78;
  --gold: #b7832d;
  --shadow: 0 18px 48px rgba(38, 27, 15, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia,
    serif;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(88, 63, 39, 0.16);
  background: rgba(247, 243, 235, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 3vw, 34px);
  font-size: 15px;
}

.main-nav a {
  color: var(--muted);
  text-decoration: none;
}

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

.language-select {
  min-width: 130px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
}

main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(340px, 1.08fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: clamp(44px, 8vw, 96px) clamp(18px, 5vw, 72px) 44px;
}

.subtitle {
  margin: 0 0 18px;
  color: var(--red);
  font-size: 18px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(48px, 8vw, 108px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
}

.hero-text {
  max-width: 660px;
  color: #4d463f;
  font-size: 20px;
  line-height: 1.8;
}

.search-panel {
  display: flex;
  max-width: 660px;
  border: 1px solid #cbbca9;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(55, 38, 20, 0.08);
}

.catalog-search {
  justify-self: end;
  width: min(100%, 760px);
}

.search-panel input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  padding: 17px 18px;
  outline: none;
}

.search-panel button {
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--ink);
  color: #fff;
  padding: 0 22px;
  cursor: pointer;
}

.hero-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  transform: rotate(-2deg);
}

.hero-gallery img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow);
}

.hero-gallery img:nth-child(2),
.hero-gallery img:nth-child(5) {
  transform: translateY(32px);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line);
  background: #211b17;
  color: #fff;
}

.stats div {
  padding: 28px clamp(18px, 5vw, 72px);
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.stats strong {
  display: block;
  font-family: Georgia, serif;
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1;
}

.stats span {
  color: #e4d3bf;
}

.catalog-section,
.pattern-section,
.play-section,
.feature-section,
.text-section {
  padding: clamp(48px, 8vw, 96px) clamp(18px, 5vw, 72px);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(260px, 0.72fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 34px;
}

.section-heading p,
.text-section p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.85;
}

.contact-section {
  border-top: 1px solid var(--line);
  background: #211b17;
  color: #fff;
}

.contact-section h2 {
  color: #fff;
}

.contact-section p {
  max-width: 920px;
  color: #e4d3bf;
}

.contact-link {
  display: inline-block;
  margin-left: 0.35em;
  color: #fff;
  text-decoration-color: rgba(255, 255, 255, 0.42);
  text-underline-offset: 4px;
}

.contact-link:hover {
  color: #f3d5b4;
}

.seo-detail {
  padding: clamp(48px, 8vw, 96px) clamp(18px, 5vw, 72px);
}

.seo-kicker {
  margin-bottom: 14px;
  color: var(--red);
  font-size: 18px;
  font-weight: 700;
}

.seo-detail h1 {
  max-width: 920px;
  font-size: clamp(46px, 7vw, 92px);
}

.seo-detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  margin-top: 34px;
}

.seo-detail figure {
  margin: 0;
  padding: clamp(18px, 3vw, 32px);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.seo-detail figure img {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
}

.seo-detail figcaption {
  margin-top: 14px;
  color: var(--muted);
  text-align: center;
}

.seo-copy {
  display: grid;
  gap: 28px;
}

.seo-copy dl {
  display: grid;
  gap: 16px;
  margin: 0;
}

.seo-copy dt {
  color: var(--muted);
  font-size: 15px;
}

.seo-copy dd {
  margin: 4px 0 0;
  font-size: 22px;
}

.seo-copy h2 {
  margin-bottom: 12px;
  font-size: 28px;
}

.seo-copy p {
  color: #4d463f;
  font-size: 18px;
  line-height: 1.85;
}

.seo-copy a {
  color: var(--red);
  text-decoration-color: rgba(185, 47, 36, 0.28);
  text-underline-offset: 4px;
}

.seo-back {
  margin-bottom: 0;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.category-list {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding-right: 4px;
}

.category-button {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.72);
  color: var(--ink);
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
}

.category-button:hover,
.category-button.is-active {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.results-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
  margin-bottom: 18px;
}

.results-toolbar h3 {
  margin-bottom: 0;
  font-size: 24px;
}

.results-toolbar span {
  color: var(--muted);
}

.mask-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
}

.mask-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(104, 77, 49, 0.14);
  background: var(--surface);
  padding: 10px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(42, 28, 12, 0.05);
}

.mask-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.mask-card img {
  width: 100%;
  aspect-ratio: 1 / 1.22;
  object-fit: contain;
  background: #fff;
}

.mask-card strong {
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.25;
}

.mask-card span {
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  padding: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.play-section {
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.pattern-section {
  background: #f3ede3;
  border-top: 1px solid var(--line);
}

.play-tools {
  max-width: 620px;
  margin-bottom: 22px;
}

.play-tools input {
  width: 100%;
  border: 1px solid #cbbca9;
  background: #fff;
  padding: 15px 16px;
  outline: none;
}

.play-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.pattern-grid {
  display: grid;
  gap: 14px;
}

.pattern-card {
  display: grid;
  grid-template-columns: minmax(160px, 0.28fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  border: 1px solid rgba(104, 77, 49, 0.16);
  background: #fffdf8;
  padding: 16px;
}

.pattern-card h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.pattern-card p {
  margin: 0;
  color: var(--muted);
}

.pattern-people {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.play-card {
  border: 1px solid rgba(104, 77, 49, 0.16);
  background: #fffdf8;
  padding: 16px;
  text-align: left;
  cursor: pointer;
}

.play-card:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
}

.play-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 19px;
}

.play-card p {
  display: -webkit-box;
  overflow: hidden;
  min-height: 0;
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.play-card span {
  color: var(--blue);
  font-size: 13px;
}

.feature-section {
  background: #ece4d7;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.photo-card {
  display: block;
  width: 100%;
  border: 0;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(42, 28, 12, 0.08);
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.photo-card span {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 14px;
  color: #4e463f;
  line-height: 1.55;
}

.photo-card strong {
  font: inherit;
  font-weight: 700;
}

.photo-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.text-section {
  display: grid;
  grid-template-columns: minmax(0, 0.48fr) minmax(280px, 0.72fr);
  gap: 34px;
  border-top: 1px solid var(--line);
}

.author-profile {
  display: grid;
  gap: 24px;
}

.author-timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.author-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 20px;
  padding: 0 0 22px;
}

.author-timeline li::before {
  content: "";
  position: absolute;
  top: 7px;
  bottom: -7px;
  left: 96px;
  width: 1px;
  background: var(--line);
}

.author-timeline li::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 91px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 4px var(--surface);
}

.author-timeline li:last-child {
  padding-bottom: 0;
}

.author-timeline li:last-child::before {
  display: none;
}

.author-timeline time {
  color: var(--blue);
  font-weight: 700;
  line-height: 1.45;
}

.author-timeline p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.mask-dialog,
.play-dialog,
.photo-dialog {
  width: min(1080px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mask-dialog::backdrop,
.play-dialog::backdrop,
.photo-dialog::backdrop {
  background: rgba(22, 18, 14, 0.62);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 26px;
}

.dialog-body {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(260px, 0.7fr);
  gap: 30px;
  padding: clamp(24px, 5vw, 54px);
}

.dialog-body img {
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  background: #fff;
}

.dialog-copy {
  align-self: center;
}

.dialog-copy h2 {
  margin-bottom: 20px;
}

.dialog-copy dl {
  display: grid;
  gap: 12px;
  margin: 0 0 28px;
}

.dialog-copy dt {
  color: var(--muted);
  font-size: 13px;
}

.dialog-copy dd {
  margin: 4px 0 0;
  font-size: 18px;
}

.related-list {
  display: grid;
  gap: 8px;
}

.pattern-details {
  display: grid;
  gap: 16px;
  margin: 0 0 28px;
}

.pattern-note {
  width: 100%;
  background: transparent;
  padding: 0;
}

.field-row {
  margin-bottom: 20px;
}

.field-row h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.field-row p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.75;
}

.pattern-note small {
  color: var(--blue);
}

.related-list button {
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
}

.index-button {
  min-width: 126px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 10px 18px;
  text-align: center;
  cursor: pointer;
}

.index-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.play-dialog-body {
  padding: clamp(24px, 5vw, 54px);
}

.play-dialog-body > p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
}

.play-dialog-body h3 {
  margin: 28px 0 10px;
  font-size: 18px;
}

.play-character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.play-character-button {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.play-character-button img {
  width: 100%;
  aspect-ratio: 1 / 1.12;
  object-fit: contain;
  background: #fff;
}

.play-character-button strong {
  display: block;
  margin-top: 8px;
}

.photo-dialog {
  width: min(1180px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
}

.photo-dialog-body {
  display: grid;
  gap: 0;
  margin: 0;
}

.photo-dialog-body img {
  width: 100%;
  max-height: calc(100vh - 190px);
  object-fit: contain;
  background: #16120e;
}

.photo-dialog-body figcaption {
  display: grid;
  gap: 8px;
  padding: 18px 22px 22px;
  color: #3f3328;
  line-height: 1.65;
}

.photo-dialog-body strong {
  font-size: 18px;
}

.photo-dialog-body span {
  color: var(--muted);
}

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

  .main-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero,
  .catalog-layout,
  .section-heading,
  .text-section,
  .seo-detail-grid,
  .dialog-body {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .catalog-search {
    justify-self: stretch;
    width: 100%;
  }

  .hero-gallery {
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    overflow-x: auto;
    transform: none;
  }

  .hero-gallery img:nth-child(2),
  .hero-gallery img:nth-child(5) {
    transform: none;
  }

  .category-list {
    position: static;
    display: flex;
    max-height: none;
    overflow-x: auto;
  }

  .category-button {
    min-width: 170px;
  }

  .author-timeline li {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 16px;
  }

  .author-timeline li::before {
    left: 74px;
  }

  .author-timeline li::after {
    left: 69px;
  }
}

@media (max-width: 620px) {
  .site-header {
    padding-inline: 14px;
  }

  .brand span:last-child {
    display: none;
  }

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

  .stats div {
    min-width: 0;
    padding: 18px 10px;
  }

  .stats strong {
    font-size: clamp(26px, 8vw, 38px);
  }

  .stats span {
    display: block;
    font-size: 13px;
    line-height: 1.35;
  }

  .search-panel {
    flex-direction: column;
  }

  .search-panel button {
    min-height: 48px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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

  .author-timeline li {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-left: 22px;
  }

  .author-timeline li::before {
    left: 5px;
  }

  .author-timeline li::after {
    left: 0;
  }
}
