:root {
  color-scheme: light;
  --bg: #fff3f7;
  --paper: #fffafd;
  --ink: #3a242d;
  --muted: #806671;
  --line: #f3d8e3;
  --coral: #d94f7a;
  --rose: #ffd6e4;
  --sage: #95b8a2;
  --mint: #edf7f1;
  --gold: #d49a57;
  --shadow: 0 20px 60px rgba(139, 64, 92, 0.13);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(255, 214, 228, 0.56) 0%, rgba(255, 243, 247, 0) 44%),
    linear-gradient(215deg, rgba(237, 247, 241, 0.62) 0%, rgba(255, 243, 247, 0) 48%),
    linear-gradient(180deg, rgba(255, 243, 247, 0.99), rgba(255, 250, 253, 0.99));
  color: var(--ink);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans CJK SC",
    system-ui,
    sans-serif;
  letter-spacing: 0;
}

body.locked {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

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

body:not(.locked) .password-gate {
  display: none;
}

body.locked .page-shell,
body.locked .lightbox {
  display: none;
}

.password-gate {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate-panel {
  width: min(520px, 100%);
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid rgba(243, 216, 227, 0.96);
  border-radius: var(--radius);
  background: rgba(255, 250, 253, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.gate-panel h1 {
  margin: 8px 0 0;
  font-size: clamp(2.35rem, 8vw, 4.6rem);
}

.gate-text {
  margin: 18px 0 24px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.8;
}

.password-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.password-field input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.password-field input:focus {
  border-color: rgba(217, 79, 122, 0.56);
  outline: 3px solid rgba(217, 79, 122, 0.14);
}

.gate-button {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  border: 0;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fffdf9;
  font-weight: 800;
}

.gate-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.gate-error {
  min-height: 26px;
  margin: 12px 0 0;
  color: var(--coral);
  font-weight: 800;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px 0;
  background: rgba(255, 243, 247, 0.86);
  backdrop-filter: blur(18px);
}

.brand,
.nav-links a {
  color: var(--ink);
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--coral);
  color: #fffdf9;
  box-shadow: 0 10px 22px rgba(217, 79, 122, 0.24);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
  background: rgba(217, 79, 122, 0.1);
  outline: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: 34px;
  align-items: center;
  min-height: calc(100svh - 104px);
  padding: 26px 0 46px;
}

.hero-copy {
  display: grid;
  gap: 20px;
  align-content: center;
}

.eyebrow {
  margin: 0;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2.7rem, 7vw, 5.7rem);
  line-height: 0.96;
  letter-spacing: 0;
  max-width: 760px;
}

.hero-text {
  margin-bottom: 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.9;
}

.album-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 10px;
  max-width: 460px;
}

.album-stats div {
  min-height: 86px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 253, 0.76);
}

.album-stats strong {
  display: block;
  color: var(--ink);
  font-size: 1.82rem;
  line-height: 1;
}

.album-stats span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.feature-media {
  position: relative;
  min-height: clamp(430px, 62vh, 680px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius);
  background: #f8dce7;
  box-shadow: var(--shadow);
}

.feature-media img,
.feature-media video {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}

.feature-caption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(58, 36, 45, 0.58);
  color: #fffdf9;
  backdrop-filter: blur(14px);
}

.feature-caption h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.feature-caption p {
  margin: 0;
  color: rgba(255, 253, 249, 0.84);
}

.feature-caption span {
  flex: 0 0 auto;
  color: rgba(255, 253, 249, 0.9);
  font-size: 0.9rem;
}

.toolbar {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 253, 0.82);
  box-shadow: 0 12px 34px rgba(139, 64, 92, 0.09);
}

.filter-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius);
  background: var(--mint);
}

.tab,
.upload-button {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  white-space: nowrap;
}

.tab {
  padding: 0 16px;
  background: transparent;
  color: #5f7465;
}

.tab.is-active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(139, 64, 92, 0.12);
}

.search-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.search-field input:focus {
  border-color: rgba(217, 79, 122, 0.56);
  outline: 3px solid rgba(217, 79, 122, 0.14);
}

.upload-button {
  display: inline-grid;
  place-items: center;
  padding: 0 18px;
  background: var(--ink);
  color: #fffdf9;
  font-weight: 800;
}

.upload-button input {
  display: none;
}

.gallery-section,
.timeline-section,
.letter-section {
  padding: 72px 0 0;
}

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

.section-heading h2,
.letter-section h2 {
  margin: 6px 0 0;
  font-size: clamp(1.9rem, 3vw, 3rem);
  letter-spacing: 0;
}

.section-note {
  margin: 0;
  color: var(--muted);
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.memory-card {
  position: relative;
  grid-column: span 4;
  min-height: 360px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: #f7d9e4;
  box-shadow: 0 14px 38px rgba(139, 64, 92, 0.12);
  color: inherit;
  text-align: left;
}

.memory-card:nth-child(5n + 1) {
  grid-column: span 7;
}

.memory-card:nth-child(5n + 2) {
  grid-column: span 5;
}

.memory-card img,
.memory-card video {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  transform: scale(1);
  transition: transform 280ms ease;
}

.memory-card:hover img,
.memory-card:hover video,
.memory-card:focus-visible img,
.memory-card:focus-visible video {
  transform: scale(1.035);
}

.memory-card:focus-visible {
  outline: 3px solid rgba(217, 79, 122, 0.36);
  outline-offset: 3px;
}

.card-overlay {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 6px;
  padding: 18px;
  background: linear-gradient(180deg, transparent, rgba(58, 36, 45, 0.84));
  color: #fffdf9;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255, 253, 249, 0.84);
  font-size: 0.86rem;
}

.card-overlay h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.35;
}

.media-type {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-grid;
  min-width: 38px;
  height: 32px;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.84);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(128, 102, 113, 0.4);
  border-radius: var(--radius);
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 14px;
  padding-left: 18px;
  border-left: 2px solid rgba(217, 79, 122, 0.24);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 253, 0.78);
}

.timeline-item::before {
  position: absolute;
  left: -26px;
  top: 26px;
  width: 12px;
  height: 12px;
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: var(--coral);
  content: "";
}

.timeline-date {
  color: var(--coral);
  font-weight: 800;
}

.timeline-item h3 {
  margin: 0 0 8px;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.letter-section {
  max-width: 820px;
  padding-bottom: 90px;
}

.letter-section p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.9;
}

.lightbox {
  width: min(980px, calc(100% - 28px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(58, 36, 45, 0.34);
}

.lightbox::backdrop {
  background: rgba(58, 36, 45, 0.5);
  backdrop-filter: blur(6px);
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.88);
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
}

.lightbox-media {
  background: #1f1b18;
}

.lightbox-media img,
.lightbox-media video {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
}

.lightbox-copy {
  padding: 22px;
}

.lightbox-copy p:first-child,
.lightbox-copy span {
  color: var(--coral);
  font-weight: 800;
}

.lightbox-copy h3 {
  margin: 6px 0;
  font-size: 1.5rem;
}

.lightbox-copy p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

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

  .feature-media {
    min-height: 520px;
  }

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

  .filter-tabs {
    width: 100%;
    grid-auto-flow: initial;
    grid-template-columns: repeat(4, 1fr);
  }

  .memory-card,
  .memory-card:nth-child(5n + 1),
  .memory-card:nth-child(5n + 2) {
    grid-column: span 6;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 22px, 1180px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .nav-links a {
    padding-inline: 8px;
  }

  h1 {
    font-size: 3.1rem;
  }

  .gate-panel h1 {
    font-size: 2.8rem;
  }

  .album-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .album-stats div {
    min-height: 78px;
    padding: 12px;
  }

  .album-stats strong {
    font-size: 1.45rem;
  }

  .feature-media {
    min-height: 430px;
  }

  .feature-caption {
    align-items: start;
    flex-direction: column;
  }

  .filter-tabs {
    overflow-x: auto;
  }

  .tab {
    padding-inline: 10px;
  }

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

  .memory-card,
  .memory-card:nth-child(5n + 1),
  .memory-card:nth-child(5n + 2) {
    grid-column: 1 / -1;
    min-height: 330px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }
}
