:root {
  color-scheme: dark;
  --bg: #15110d;
  --panel: rgba(36, 30, 24, 0.74);
  --panel-strong: #2b241c;
  --text: #fff6e9;
  --muted: #d3bfa3;
  --line: rgba(255, 240, 215, 0.16);
  --accent: #ffd38a;
  --accent-2: #f59ab0;
  --green: #75c59d;
  --blue: #88b8d8;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 211, 138, 0.14), transparent 28rem),
    radial-gradient(circle at 82% 18%, rgba(245, 154, 176, 0.1), transparent 26rem),
    linear-gradient(180deg, #17130f, var(--bg));
  color: var(--text);
  font-family: "LXGW WenKai", "霞鹜文楷", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

body.locked {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.auth-gate {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(115deg, rgba(21, 17, 13, 0.84), rgba(21, 17, 13, 0.94)),
    radial-gradient(circle at 24% 18%, rgba(245, 154, 176, 0.16), transparent 24rem),
    radial-gradient(circle at 82% 24%, rgba(255, 211, 138, 0.18), transparent 28rem),
    var(--bg);
}

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

.site-shell {
  min-height: 100vh;
}

body.locked .site-shell {
  visibility: hidden;
}

.auth-card {
  width: min(440px, 100%);
  position: relative;
  padding: 38px 30px 34px;
  border: 1px solid rgba(255, 240, 215, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 211, 138, 0.12), transparent 38%),
    rgba(31, 26, 21, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 14px 14px auto auto;
  width: 74px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 211, 138, 0.92));
}

.auth-card h1 {
  margin-bottom: 28px;
  font-size: clamp(38px, 8vw, 58px);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-wrap: balance;
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

.auth-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.75;
}

.auth-card label {
  display: grid;
  gap: 8px;
  margin: 22px 0 16px;
  color: var(--muted);
  font-weight: 800;
}

.auth-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 15px;
  outline: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
}

.auth-card input:focus {
  border-color: var(--accent);
}

.auth-card button {
  width: 100%;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.auth-card small {
  display: block;
  min-height: 20px;
  margin-top: 12px;
  color: var(--accent-2);
}

.hero {
  min-height: 76vh;
  position: relative;
  overflow: hidden;
  padding: 28px clamp(20px, 5vw, 72px);
  display: grid;
  align-content: space-between;
  background-image:
    linear-gradient(90deg, rgba(21, 17, 13, 0.92), rgba(21, 17, 13, 0.48) 48%, rgba(21, 17, 13, 0.18)),
    var(--hero-image);
  background-size: cover;
  background-position: var(--hero-position, center);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(transparent, rgba(21, 17, 13, 0.96));
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(255, 246, 233, 0.88);
}

.nav-actions {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(31, 26, 21, 0.46);
  backdrop-filter: blur(20px);
}

.nav-actions a,
.nav-actions button,
.ghost-button,
.primary-button {
  border-radius: 999px;
  padding: 12px 17px;
  font-size: 14px;
}

.nav-actions a:hover,
.nav-actions button:hover,
.ghost-button:hover {
  background: rgba(255, 255, 255, 0.09);
}

.nav-actions button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 820px;
  padding: 13vh 0 12vh;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: #ffdda4;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 22px;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-wrap: balance;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0.035em;
}

.hero-copy {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.primary-button {
  background: linear-gradient(135deg, #ffe0a4, #ffc86f);
  color: #22170d;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(255, 200, 111, 0.18);
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(17, 16, 14, 0.48);
}

main {
  width: min(1220px, calc(100% - 36px));
  margin: 0 auto;
  padding: 42px 0 88px;
}

.section-head,
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin: 64px 0 20px;
}

.section-head {
  display: block;
  max-width: 860px;
}

.section-head p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.75;
}

.timeline {
  position: relative;
  display: flex;
  gap: 18px;
  margin: 34px 0 64px;
  padding: 46px 4px 16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 4px;
  right: 4px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 211, 138, 0.92), rgba(255, 248, 237, 0.1));
}

.timeline-item {
  position: relative;
  flex: 0 0 min(320px, 78vw);
  scroll-snap-align: start;
}

.timeline-dot {
  position: absolute;
  top: -33px;
  left: 22px;
  width: 16px;
  height: 16px;
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 211, 138, 0.52), 0 0 18px rgba(255, 211, 138, 0.22);
}

.timeline-card,
.album-card,
.photo-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18);
}

.clickable-card {
  cursor: pointer;
}

.clickable-card:hover {
  border-color: rgba(255, 207, 112, 0.52);
  transform: translateY(-2px);
  transition: border-color 180ms ease, transform 180ms ease;
}

.timeline-card {
  min-height: 360px;
  background:
    linear-gradient(180deg, rgba(255, 240, 215, 0.06), transparent 48%),
    var(--panel);
}

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

.timeline-body {
  padding: 18px;
}

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

.timeline-card h3,
.album-card h3 {
  margin: 10px 0;
  font-size: 22px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 240, 215, 0.09);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.album-card {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

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

.album-body {
  padding: 18px;
}

.album-meta {
  color: var(--muted);
  line-height: 1.65;
}

.toolbar {
  align-items: end;
}

.active-filter {
  margin: 0;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.chip.active {
  border-color: transparent;
  background: var(--text);
  color: var(--bg);
}

.masonry {
  column-count: 4;
  column-gap: 16px;
}

.photo-card {
  display: inline-block;
  position: relative;
  width: 100%;
  margin: 0 0 16px;
  cursor: zoom-in;
}

.photo-card img,
.photo-card video {
  display: block;
  width: 100%;
  min-height: 180px;
  background: #100d0a;
}

.photo-card img:not([src]) {
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.05), rgba(255, 207, 112, 0.12), rgba(255, 255, 255, 0.05)),
    #080807;
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

.media-placeholder {
  display: grid;
  min-height: 190px;
  place-items: center;
  background: #080807;
  color: var(--muted);
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

.photo-card figcaption {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
}

.note-toggle {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 240, 215, 0.2);
  border-radius: 999px;
  background: rgba(31, 26, 21, 0.72);
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  opacity: 0;
  pointer-events: auto;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease, background 160ms ease;
  backdrop-filter: blur(14px);
}

.photo-card:hover .note-toggle,
.photo-card:focus-within .note-toggle,
.note-panel.note-open .note-toggle,
.note-panel.has-note .note-toggle {
  opacity: 1;
  transform: translateY(0);
}

.note-toggle:hover,
.note-panel.has-note .note-toggle {
  border-color: rgba(255, 207, 112, 0.62);
  background: rgba(255, 207, 112, 0.94);
  color: #17120b;
}

.note-editor {
  display: none;
  margin-right: 46px;
  padding: 8px;
  border: 1px solid rgba(255, 240, 215, 0.16);
  border-radius: 12px;
  background: rgba(31, 26, 21, 0.8);
  pointer-events: auto;
  backdrop-filter: blur(16px);
}

.note-panel.note-open .note-editor {
  display: block;
}

.memory-note {
  display: block;
  width: 100%;
  min-height: 48px;
  resize: vertical;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 10px;
  outline: 0;
  background: rgba(255, 240, 215, 0.06);
  color: var(--text);
  font: inherit;
  line-height: 1.55;
}

.memory-note::placeholder {
  color: rgba(197, 183, 161, 0.66);
}

.memory-note:focus {
  border-color: rgba(255, 207, 112, 0.52);
  background: rgba(255, 255, 255, 0.07);
}

.photo-card b {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.upload-panel {
  display: grid;
  justify-items: center;
  gap: 16px;
  margin: 4px 0 72px;
}

.upload-toggle {
  border: 1px solid rgba(255, 240, 215, 0.16);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255, 240, 215, 0.04);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.upload-toggle:hover,
.upload-toggle[aria-expanded="true"] {
  border-color: rgba(255, 207, 112, 0.48);
  color: var(--accent);
  background: rgba(255, 207, 112, 0.08);
}

.local-album-form {
  display: grid;
  width: min(560px, 100%);
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.local-album-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
}

.local-album-form button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.lightbox {
  width: min(1100px, calc(100% - 28px));
  max-height: 92vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #100d0a;
  color: var(--text);
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.76);
}

.close-button {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: #111;
  font-size: 28px;
  cursor: pointer;
}

.lightbox-media img,
.lightbox-media video {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #050505;
}

.lightbox-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  color: var(--muted);
}

.lightbox-meta strong {
  color: var(--text);
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .hero {
    min-height: 620px;
  }

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

  .toolbar {
    display: block;
  }

  .upload-panel {
    grid-template-columns: 1fr;
  }

  .masonry {
    column-count: 2;
  }
}

@media (max-width: 620px) {
  .topbar,
  .nav-actions,
  .lightbox-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions {
    width: 100%;
    border-radius: 8px;
  }

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

  .masonry {
    column-count: 1;
  }
}
