.type-gallery {
  --paper: #fbfbf9;
  --ink: #252822;
  --muted: #5e635a;
  --rule: #ced1c9;
  --photo-mat: #e7e8e3;
  background: var(--paper);
  color: var(--ink);
}

[data-theme='dark'] .type-gallery {
  --paper: #171917;
  --ink: #f0f1ea;
  --muted: #b5b9ae;
  --rule: #454941;
  --photo-mat: #272a26;
}

.type-gallery #content-inner {
  max-width: 1216px;
  padding: clamp(28px, 4vw, 64px) clamp(18px, 4.6vw, 64px) clamp(48px, 6vw, 84px);
}

.type-gallery #page-header.not-top-img,
.type-gallery #footer {
  background: var(--paper);
}

.type-gallery #nav { opacity: 1; }
.type-gallery #nav .fa-fw { display: inline-block; width: 1.25em; }
.type-gallery #page-header.not-top-img,
.type-gallery #nav.show,
.type-gallery #content-inner { animation: none; }
.type-gallery #footer > *,
.type-gallery #footer a { color: var(--muted); }
[data-theme='dark'] .photo-library img { filter: none; }

.photo-library {
  width: 100%;
  min-width: 0;
  font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  line-height: 1.5;
}

.photo-library h1,
.photo-library h2 {
  margin: 0;
  color: var(--ink);
  font-family: 'Songti SC', 'STSong', 'Noto Serif CJK SC', Georgia, serif;
  font-weight: 600;
  line-height: 1.18;
}

.photo-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: clamp(20px, 2.5vw, 34px);
}

.photo-heading h1 { font-size: clamp(2.25rem, 4.1vw, 3.8rem); }

.photo-meta,
.album-meta,
.photo-archive {
  color: var(--muted);
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}

.photo-meta { display: flex; align-items: center; gap: 12px; }
.photo-meta > * + * { border-inline-start: 1px solid var(--rule); padding-inline-start: 12px; }

.album-shelf {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 54px) clamp(18px, 2.5vw, 32px);
}

.album-card { display: block; color: var(--ink); }
.album-feature { grid-column: 1 / -1; }
.album-cover { overflow: hidden; aspect-ratio: 16 / 10; background: var(--photo-mat); }
.album-feature .album-cover { aspect-ratio: 2.55; }
.album-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.album-feature img { object-position: center 48%; }

.album-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 0 16px;
  border-bottom: 1px solid var(--rule);
}

.album-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.album-label h2 { font-size: clamp(1.35rem, 2.25vw, 2.1rem); }
.album-arrow { color: var(--ink); font-size: 1.45rem; line-height: 1; }
.photo-library a:focus-visible,
.photo-library button:focus-visible { outline: 3px solid #00867d; outline-offset: 3px; }
.photo-library a:hover h2,
.photo-archive:hover { text-decoration: underline; text-underline-offset: .2em; }

.photo-archive {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.photo-archive { margin-top: 22px; }
.gallery-missing { color: var(--muted); }

.photo-library [hidden] { display: none !important; }
.wall-heading, .wall-caption { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.wall-library { font-family: system-ui, 'PingFang SC', sans-serif; }
.wall-heading { align-items: flex-end; margin-bottom: clamp(20px, 3vw, 40px); }
.wall-heading h1 { font: 600 clamp(2.15rem, 4.3vw, 4.3rem)/1.13 system-ui, sans-serif; letter-spacing: -.04em; }
.wall-heading p { color: var(--muted); margin: .65em 0 0; font-size: .95rem; }
.wall-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.8vw, 36px) clamp(12px, 1.8vw, 26px); }
.wall-card { min-width: 0; }
.wall-skeleton { aspect-ratio: 3/2; margin-bottom: 44px; background: var(--photo-mat); border-radius: 9px; }
.wall-image { display: block; aspect-ratio: 3/2; overflow: hidden; border-radius: 9px; background: var(--photo-mat); }
.wall-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wall-image-note { display: grid; place-items: center; height: 100%; padding: 12px; color: var(--muted); text-align: center; font-size: .88rem; }
.wall-caption { gap: 4px; font-size: .85rem; line-height: 1.2; }
.wall-source, .wall-copy { display: inline-flex; align-items: center; gap: .4em; min-height: 44px; padding: 0; color: var(--muted); background: none; font: inherit; }
.wall-copy { cursor: pointer; }
.wall-source:hover, .wall-copy:hover { text-decoration: underline; text-underline-offset: .22em; }
.wall-shuffle, .wall-more { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 20px; cursor: pointer; border-radius: 999px; font: 550 .92rem/1 system-ui, sans-serif; white-space: nowrap; }
.wall-shuffle { background: var(--ink); color: var(--paper); }
.wall-shuffle span { font-size: 1.4em; }
.wall-more { color: var(--ink); background: var(--photo-mat); }
.wall-more:disabled, .wall-shuffle:disabled { opacity: .65; cursor: progress; }
.wall-actions { text-align: center; margin-top: clamp(22px, 4vw, 50px); }
.wall-status { color: var(--muted); font-size: .88rem; }

@media (max-width: 700px) {
  .wall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall-heading { align-items: center; }
}
@media (max-width: 600px) {
  .photo-heading { display: grid; gap: 10px; }
  .album-shelf { display: grid; grid-template-columns: minmax(0, 1fr); }
  .album-cover, .album-feature .album-cover { aspect-ratio: 4 / 3; }
  .album-caption { padding: 12px 0; }
  .wall-heading { flex-wrap: wrap; gap: 12px; }
  .wall-heading p { max-width: 27ch; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .wall-image img { transition: transform .22s ease-out; }
  .wall-image:hover img { transform: scale(1.018); }
}
