:root {
  --bg: #f6efe6;
  --bg-deep: #ebe1d4;
  --paper: rgba(255, 251, 245, 0.82);
  --ink: #4a3b35;
  --ink-soft: #7a665d;
  --rose: #c58f86;
  --rose-deep: #a86f66;
  --gold: #c4a574;
  --line: rgba(122, 102, 93, 0.18);
  --shadow: 0 18px 50px rgba(74, 59, 53, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", serif;
  background:
    radial-gradient(circle at top left, rgba(197, 143, 134, 0.16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(196, 165, 116, 0.14), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, #f3ebe1 48%, var(--bg-deep) 100%);
  line-height: 1.7;
}

body.mode-latest {
  overflow: hidden;
  background: #120f12;
}

.latest-view {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: #120f12;
}

.latest-frame {
  flex: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: #120f12;
}

.latest-dock {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 2;
  transform: translateX(-50%);
  padding: 0;
  pointer-events: none;
  background: none;
}

.latest-dock::before {
  display: none;
}

.latest-label {
  display: none;
}

.archive-entry-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  pointer-events: auto;
  appearance: none;
  border: 1px solid rgba(210, 154, 143, 0.5);
  background: rgba(255, 248, 242, 0.82);
  color: #8f5d54;
  min-width: auto;
  padding: 7px 14px;
  border-radius: 999px;
  font-family: "Noto Serif SC", serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(120, 72, 62, 0.16);
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-icon {
  font-size: 0.82rem;
  line-height: 1;
}

.btn-text {
  line-height: 1;
}

.archive-entry-btn:hover,
.archive-entry-btn:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 252, 247, 0.94);
  border-color: rgba(197, 143, 134, 0.72);
  box-shadow: 0 6px 18px rgba(168, 111, 102, 0.22);
  outline: none;
}

.archive-view {
  min-height: 100vh;
}

.archive-view[hidden],
.latest-view[hidden] {
  display: none !important;
}

@keyframes warmBreath {
  0%,
  100% {
    box-shadow:
      0 10px 24px rgba(168, 111, 102, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }
  50% {
    box-shadow:
      0 14px 28px rgba(197, 143, 134, 0.28),
      0 0 18px rgba(255, 214, 201, 0.35),
      inset 0 1px 0 rgba(255, 255, 255, 0.95);
  }
}

@keyframes heartFloat {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.85;
  }
  50% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

.paper-texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(0deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2)),
    repeating-linear-gradient(
      90deg,
      rgba(74, 59, 53, 0.015) 0,
      rgba(74, 59, 53, 0.015) 1px,
      transparent 1px,
      transparent 4px
    );
}

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  opacity: 0.45;
}

.ambient-glow-a {
  width: 280px;
  height: 280px;
  top: 8%;
  right: 8%;
  background: rgba(197, 143, 134, 0.28);
}

.ambient-glow-b {
  width: 320px;
  height: 320px;
  bottom: 6%;
  left: 4%;
  background: rgba(196, 165, 116, 0.22);
}

.site-header,
.archive-layout,
.site-footer {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  padding: 72px 0 36px;
  text-align: center;
}

.site-kicker {
  margin: 0 0 10px;
  letter-spacing: 0.32em;
  text-transform: lowercase;
  font-size: 0.78rem;
  color: var(--rose-deep);
}

.site-title {
  margin: 0;
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 400;
  letter-spacing: 0.08em;
}

.site-subtitle {
  max-width: 620px;
  margin: 18px auto 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

.archive-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  backdrop-filter: blur(8px);
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.meta-dot {
  color: var(--gold);
}

.archive-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  padding-bottom: 48px;
}

.panel-label {
  margin: 0 0 14px;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: var(--rose-deep);
  font-weight: 500;
}

.timeline-panel,
.gallery-panel {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.timeline-panel {
  padding: 28px 24px;
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 8px;
  border-left: 1px solid var(--line);
}

.timeline-item {
  position: relative;
  padding: 0 0 24px 22px;
  animation: fadeUp 0.7s ease both;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--rose);
  transition: transform 0.25s ease, background 0.25s ease;
}

.timeline-item.is-active::before,
.timeline-item:hover::before {
  transform: scale(1.15);
  background: var(--rose);
}

.timeline-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.timeline-date {
  display: block;
  font-size: 0.82rem;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.timeline-title {
  display: block;
  margin-top: 4px;
  font-size: 0.98rem;
}

.gallery-panel {
  padding: 28px;
}

.gallery-hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.memory-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.72), rgba(255, 248, 241, 0.9));
  text-decoration: none;
  color: inherit;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
  animation: fadeUp 0.8s ease both;
}

.memory-card:hover,
.memory-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(197, 143, 134, 0.45);
  box-shadow: 0 16px 34px rgba(74, 59, 53, 0.1);
  outline: none;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.card-emoji {
  font-size: 1.5rem;
}

.card-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(197, 143, 134, 0.12);
  color: var(--rose-deep);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.card-date {
  margin: 18px 0 8px;
  font-size: 0.84rem;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.card-title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.45;
}

.card-summary {
  margin: 12px 0 0;
  flex: 1;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.card-action {
  margin-top: 18px;
  font-size: 0.88rem;
  color: var(--rose-deep);
  letter-spacing: 0.12em;
}

.site-footer {
  padding: 10px 0 56px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.footer-note {
  margin-top: 8px;
  color: var(--rose-deep);
  letter-spacing: 0.16em;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .archive-layout {
    grid-template-columns: 1fr;
  }

  .timeline-panel {
    position: static;
    max-height: none;
  }

  .timeline {
    display: grid;
    gap: 12px;
    border-left: none;
    padding-left: 0;
  }

  .timeline-item {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.45);
  }

  .timeline-item::before {
    display: none;
  }
}

@media (max-width: 600px) {
  .site-header {
    padding-top: 48px;
  }

  .gallery-panel,
  .timeline-panel {
    padding: 20px;
  }

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