:root {
  color-scheme: light;
  --ink: #302821;
  --ink-soft: #695d52;
  --paper: #f6f0e5;
  --paper-deep: #eadfcd;
  --card: #fffaf1;
  --brick: #8f3429;
  --brick-dark: #64241f;
  --gold: #b68743;
  --line: rgba(96, 66, 45, 0.2);
  --shadow: 0 1rem 2.5rem rgba(68, 40, 24, 0.11);
  --content: 72rem;
  --reading: 48rem;
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-synthesis: none;
  line-height: 1.75;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  min-width: 20rem;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(111, 77, 49, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 2rem;
}

a {
  color: inherit;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 1rem;
  color: #fff;
  background: var(--brick-dark);
  border-radius: 0.3rem;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 240, 229, 0.95);
  backdrop-filter: blur(0.75rem);
}

.header-inner {
  width: min(100% - 2rem, var(--content));
  margin-inline: auto;
  padding-block: 0.8rem;
}

.site-name {
  display: inline-block;
  color: var(--brick-dark);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 0.35rem 1rem;
  margin-top: 0.55rem;
  padding-bottom: 0.2rem;
  overflow-x: auto;
  font-family: system-ui, "Microsoft YaHei", sans-serif;
  font-size: 0.82rem;
  white-space: nowrap;
  scrollbar-width: thin;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--brick);
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: calc(100svh - 5rem);
  place-items: center;
  padding: 5rem 1.25rem;
  overflow: hidden;
  color: #fff9ec;
  background:
    radial-gradient(circle at 75% 20%, rgba(223, 177, 103, 0.26), transparent 28%),
    linear-gradient(145deg, #4c1b19 0%, #852f28 52%, #3c1917 100%);
}

.hero::before,
.hero::after {
  position: absolute;
  z-index: -1;
  content: "";
  border: 1px solid rgba(255, 235, 197, 0.22);
  transform: rotate(45deg);
}

.hero::before {
  width: 12rem;
  height: 12rem;
  top: -5rem;
  left: -5rem;
}

.hero::after {
  width: 16rem;
  height: 16rem;
  right: -8rem;
  bottom: -7rem;
}

.hero-content {
  max-width: 46rem;
  text-align: center;
}

.eyebrow,
.chapter-number,
.hero-date,
.site-footer {
  font-family: system-ui, "Microsoft YaHei", sans-serif;
}

.eyebrow {
  margin: 0 0 1.2rem;
  color: #e8c78e;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.55rem, 11vw, 5.8rem);
  line-height: 1.12;
  letter-spacing: 0.08em;
  text-wrap: balance;
}

.hero-subtitle {
  margin: 1.4rem 0 0;
  color: #f4dfba;
  font-size: clamp(1.05rem, 4vw, 1.5rem);
  letter-spacing: 0.08em;
}

.hero-date {
  margin: 1.1rem 0 0;
  color: rgba(255, 249, 236, 0.7);
  font-size: 0.84rem;
}

.hero-link {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.75rem 1.3rem;
  border: 1px solid rgba(255, 244, 219, 0.55);
  border-radius: 999px;
  text-decoration: none;
}

.hero-link:hover,
.hero-link:focus-visible {
  color: var(--brick-dark);
  background: #fff4db;
}

.hero-mark {
  position: absolute;
  right: 1.25rem;
  bottom: 1.5rem;
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.45rem;
  border: 1px solid rgba(255, 244, 219, 0.55);
  color: #f0d3a3;
  font-size: 0.75rem;
  line-height: 1;
}

.story-shell {
  width: min(100% - 2rem, var(--content));
  margin-inline: auto;
}

.story-section,
.gallery-section {
  padding-block: clamp(4rem, 10vw, 8rem);
  border-bottom: 1px solid var(--line);
}

.section-heading {
  max-width: var(--reading);
  margin: 0 auto 2.25rem;
}

.chapter-number {
  margin: 0 0 0.45rem;
  color: var(--brick);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.2em;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.9rem, 7vw, 3.3rem);
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-wrap: balance;
}

.section-heading h2::after {
  display: block;
  width: 3.5rem;
  height: 0.2rem;
  margin-top: 1rem;
  background: linear-gradient(90deg, var(--brick), var(--gold));
  content: "";
}

.story-content {
  max-width: var(--reading);
  min-height: 3rem;
  margin-inline: auto;
  color: var(--ink-soft);
  font-size: clamp(1rem, 3vw, 1.14rem);
}

.photo-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 2.2rem;
}

.photo-grid:empty,
.gallery-grid:empty {
  display: none;
}

.photo-card,
.gallery-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--card);
  box-shadow: var(--shadow);
}

.photo-card img,
.gallery-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--paper-deep);
}

.photo-card figcaption,
.gallery-card figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  color: var(--ink-soft);
  font-family: system-ui, "Microsoft YaHei", sans-serif;
  font-size: 0.78rem;
}

.question-section {
  margin-block: 2rem;
  padding-inline: 1.25rem;
  border: 1px solid rgba(143, 52, 41, 0.24);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(255, 250, 241, 0.9), rgba(234, 223, 205, 0.65));
}

.gallery-section {
  border-bottom: 0;
}

.gallery-intro,
.gallery-note {
  max-width: var(--reading);
  margin-inline: auto;
  color: var(--ink-soft);
}

.gallery-category {
  margin-top: clamp(3rem, 8vw, 5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.gallery-category-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.gallery-category h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.35rem, 5vw, 2rem);
}

.gallery-count {
  flex: 0 0 auto;
  padding: 0.25rem 0.65rem;
  border: 1px solid rgba(143, 52, 41, 0.22);
  border-radius: 999px;
  color: var(--brick);
  background: rgba(255, 250, 241, 0.72);
  font-family: system-ui, "Microsoft YaHei", sans-serif;
  font-size: 0.78rem;
}

.gallery-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.gallery-index a {
  overflow: hidden;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  color: var(--ink-soft);
  background: rgba(255, 250, 241, 0.72);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-card figcaption span:first-child {
  flex: 0 0 auto;
  color: var(--brick);
  font-weight: 700;
}

.gallery-card figcaption span:last-child {
  min-width: 0;
  text-align: right;
}

.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: var(--reading);
  margin-inline: auto;
}

.site-footer {
  padding: 2.5rem 1rem;
  color: rgba(255, 249, 236, 0.72);
  background: #3d1b18;
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.site-footer p {
  margin: 0;
}

@media (min-width: 40rem) {
  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
  }

  .site-nav {
    margin-top: 0;
  }

  .photo-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }

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

  .question-section {
    padding-inline: 3rem;
  }
}

@media (min-width: 64rem) {
  .photo-grid,
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-mark {
    right: 3rem;
    bottom: 3rem;
  }
}

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