:root {
  color-scheme: light;
  --ink: #20313b;
  --muted: #64757d;
  --paper: #f6faf2;
  --paper-deep: #eaf4e6;
  --line: #d9e2d3;
  --coral: #b94d3e;
  --teal: #287b8e;
  --gold: #d39b36;
  --green: #4d8d62;
  --shadow: 0 18px 48px rgba(43, 66, 70, .14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 14%, rgba(211, 155, 54, .16), transparent 24rem),
    radial-gradient(circle at 86% 4%, rgba(40, 123, 142, .13), transparent 26rem),
    linear-gradient(180deg, #fbfdf8 0%, var(--paper) 48%, var(--paper-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgba(185, 77, 62, .18) 0 16px, transparent 16px),
    linear-gradient(90deg, rgba(40, 123, 142, .18) 0 12px, transparent 12px),
    linear-gradient(90deg, rgba(77, 141, 98, .16) 0 14px, transparent 14px);
  background-size: 220px 4px, 260px 3px, 310px 3px;
  background-position: 20px 86px, 80px 310px, 0 650px;
  opacity: .55;
}

.page-shell {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 30px 0 56px;
  overflow: clip;
}

.wall-hero {
  min-height: 64vh;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr);
  gap: 32px;
  align-items: stretch;
  padding: 34px;
  border: 1px solid rgba(217, 226, 211, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .74);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.kicker {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--teal);
}

h1 {
  margin: 0;
  max-width: 11em;
  font-size: clamp(2.45rem, 5.7vw, 5.7rem);
  line-height: 1.06;
  letter-spacing: 0;
}

.subtitle {
  margin: 22px 0 0;
  max-width: 18em;
  font-size: clamp(1.45rem, 2.4vw, 2.2rem);
  font-weight: 800;
  line-height: 1.55;
  color: var(--coral);
}

.hero-note {
  margin: 12px 0 0;
  max-width: 20em;
  font-family: "KaiTi", "STKaiti", serif;
  font-size: clamp(1.15rem, 1.6vw, 1.55rem);
  line-height: 1.7;
  color: #7b5550;
}

.hero-moments {
  position: relative;
  min-height: 500px;
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .94), rgba(255, 255, 255, .24) 38%, transparent 68%),
    linear-gradient(135deg, rgba(40, 123, 142, .12), rgba(211, 155, 54, .14));
}

.hero-moments::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 8px;
  pointer-events: none;
}

.moment-feature,
.moment-float {
  appearance: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: transparent;
}

.moment-feature {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(72%, 520px);
  aspect-ratio: 16 / 10;
  transform: translate(-50%, -50%);
  overflow: hidden;
  border-radius: 8px;
  border: 10px solid #fffefa;
  box-shadow: 0 30px 72px rgba(40, 57, 61, .22);
  animation: featureBreath 7.2s ease-in-out infinite;
}

.moment-feature img,
.moment-float img,
.student-card img,
.lightbox img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.moment-glow {
  position: absolute;
  inset: -20%;
  background: linear-gradient(115deg, transparent 0 35%, rgba(255, 255, 255, .36) 45%, transparent 56% 100%);
  transform: translateX(-55%);
  animation: sheen 4.8s ease-in-out infinite;
}

.moment-caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  min-height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(180deg, rgba(22, 39, 47, .1), rgba(22, 39, 47, .72));
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}

.moment-orbit {
  position: absolute;
  inset: 0;
}

.moment-float {
  position: absolute;
  z-index: 1;
  width: 142px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 8px;
  border: 7px solid #fffefa;
  box-shadow: 0 16px 38px rgba(40, 57, 61, .18);
  animation: floatCard 6s ease-in-out infinite;
}

.moment-float:hover,
.moment-feature:hover {
  filter: saturate(1.08);
}

.moment-float-1 { left: 5%; top: 7%; animation-delay: -.2s; }
.moment-float-2 { right: 8%; top: 6%; width: 128px; animation-delay: -1.1s; }
.moment-float-3 { left: 2%; bottom: 10%; width: 128px; animation-delay: -2s; }
.moment-float-4 { right: 3%; bottom: 12%; animation-delay: -3.1s; }
.moment-float-5 { left: 34%; top: 2%; width: 118px; animation-delay: -4s; }
.moment-float-6 { right: 34%; bottom: 2%; width: 118px; animation-delay: -4.8s; }
.moment-float-7 { left: 18%; top: 48%; width: 104px; animation-delay: -1.7s; }
.moment-float-8 { right: 19%; top: 48%; width: 104px; animation-delay: -2.7s; }

.moment-dots {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 3;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

.moment-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(32, 49, 59, .28);
}

.moment-dots span.is-active {
  width: 22px;
  border-radius: 999px;
  background: var(--teal);
}

@keyframes featureBreath {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.025); }
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-14px) rotate(1deg); }
}

@keyframes sheen {
  0%, 52% { transform: translateX(-62%); }
  78%, 100% { transform: translateX(62%); }
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(220px, .8fr);
  align-items: center;
  gap: 18px;
  margin: 26px 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(217, 226, 211, .94);
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px);
}

.toolbar strong {
  display: block;
  font-size: 1.08rem;
}

.toolbar span {
  color: var(--muted);
  font-size: .92rem;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.filter-button {
  min-width: 82px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: #fffdf8;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.filter-button.is-active {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.search-box input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.search-box input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(40, 123, 142, .14);
}

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

.student-card {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 286px;
  padding: 8px 8px 10px;
  border: 1px solid rgba(217, 226, 211, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 14px 34px rgba(38, 56, 62, .12);
  text-align: inherit;
  font: inherit;
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease;
}

.student-card:hover,
.student-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 22px 46px rgba(38, 56, 62, .18);
  outline: none;
}

.student-photo {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 6px;
  background: #dfe8db;
  cursor: pointer;
}

.download-button {
  margin-top: 9px;
  min-height: 40px;
  padding: 3px 8px;
  display: grid;
  place-items: center;
  border: 1px solid #eadfbd;
  border-radius: 999px;
  background: #fffdf7;
  font-weight: 700;
  font-size: .9rem;
  line-height: 1.25;
  text-align: center;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

button.download-button {
  width: 100%;
  font: inherit;
}

.blessing {
  margin-top: 34px;
  padding: 36px clamp(22px, 5vw, 72px) 42px;
  border: 1px solid rgba(217, 226, 211, .95);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--shadow);
}

.blessing h2 {
  margin: 0 0 16px;
  text-align: center;
  color: var(--coral);
  font-size: clamp(1.45rem, 2.4vw, 2.2rem);
  letter-spacing: 0;
}

.blessing p {
  margin: 0 auto;
  max-width: 48em;
  font-family: "KaiTi", "STKaiti", serif;
  font-size: clamp(1.12rem, 1.5vw, 1.45rem);
  line-height: 1.9;
  text-align: center;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 28px;
  background: rgba(18, 30, 36, .82);
}

.lightbox.is-open {
  display: grid;
}

.lightbox figure {
  margin: 0;
  width: min(92vw, 1100px);
  max-height: 92vh;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(92vh - 70px);
  width: auto;
  height: auto;
  border: 10px solid #fffefa;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .34);
  background: #fffefa;
}

.lightbox figcaption {
  color: #fffefa;
  font-size: 1.2rem;
  font-weight: 700;
}

.lightbox-thumbs {
  max-width: min(92vw, 780px);
  display: flex;
  justify-content: center;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 2px;
}

.thumb-button {
  width: 72px;
  height: 58px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, .45);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, .16);
  cursor: pointer;
}

.thumb-button.is-active {
  border-color: #fffefa;
  box-shadow: 0 0 0 3px rgba(211, 155, 54, .75);
}

.thumb-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.icon-button {
  position: fixed;
  z-index: 21;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, .46);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .13);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.close-button {
  top: 22px;
  right: 22px;
}

.nav-button {
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
}

.prev-button {
  left: 22px;
}

.next-button {
  right: 22px;
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 20px, 760px);
    padding-top: 10px;
  }

  .wall-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .hero-moments {
    min-height: 330px;
  }

  .moment-feature {
    width: 78%;
  }

  .moment-float {
    width: 96px;
    border-width: 5px;
  }

  .toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .search-box {
    min-width: 0;
  }

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

  .student-card {
    min-height: 252px;
  }

  .nav-button {
    top: auto;
    bottom: 22px;
    transform: none;
  }
}

@media (max-width: 460px) {
  .student-grid {
    grid-template-columns: 1fr;
  }

  .student-card {
    min-height: auto;
  }

  .hero-moments {
    min-height: 300px;
  }

  .moment-feature {
    width: 86%;
  }

  .moment-float-5,
  .moment-float-6,
  .moment-float-7,
  .moment-float-8 {
    display: none;
  }
}
