.memory-detail-page {
  --memory-accent: #4a5f6f;
  --memory-accent-soft: rgba(107, 132, 153, 0.14);
  --memory-border: rgba(179, 197, 212, 0.7);
  --memory-text: #3a4855;
  --memory-muted: #5a6b7a;
  --memory-bg: linear-gradient(180deg, rgba(243, 246, 249, 0.98) 0%, rgba(232, 238, 242, 0.94) 100%);
  max-width: 1120px;
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
}

.memory-detail-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.8rem;
}

.memory-detail-heading {
  min-width: 0;
  flex: 1;
}

.memory-detail-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  color: var(--memory-muted);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.memory-detail-breadcrumb a {
  color: var(--memory-text);
  text-decoration: none;
}

.memory-detail-breadcrumb a:hover {
  color: var(--memory-accent);
}

.memory-detail-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem 1.5rem;
  padding-top: 0.15rem;
}

.memory-detail-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.memory-detail-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(179, 197, 212, 0.8);
  background: rgba(255, 255, 255, 0.78);
  color: #4a5f6f;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.memory-detail-pill-period {
  border-color: rgba(152, 171, 186, 0.82);
  background: linear-gradient(180deg, rgba(233, 239, 243, 0.95) 0%, rgba(214, 223, 230, 0.92) 100%);
  color: #506272;
}

.memory-detail-pill-muted {
  border-style: dashed;
  color: var(--memory-muted);
}

.memory-detail-attributes {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.8rem;
  color: var(--memory-muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.memory-detail-attributes span + span {
  position: relative;
  padding-left: 0.85rem;
}

.memory-detail-attributes span + span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 0.95rem;
  background: rgba(179, 197, 212, 0.9);
  transform: translateY(-50%);
}

.memory-detail-top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.7rem;
}

.moderation-delete-form {
  margin: 0;
}

.memory-detail-ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(179, 197, 212, 0.95);
  background: transparent;
  color: var(--memory-text);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.memory-detail-ghost-button:hover {
  border-color: rgba(107, 132, 153, 0.75);
  color: var(--memory-accent);
  background: rgba(107, 132, 153, 0.08);
}

.memory-detail-ghost-danger:hover {
  border-color: rgba(90, 107, 122, 0.75);
  color: #3f5361;
  background: rgba(90, 107, 122, 0.08);
}

.memory-detail-article {
  background: var(--memory-bg);
  border: 1px solid var(--memory-border);
  border-radius: 28px;
  box-shadow: 0 18px 48px rgba(58, 72, 85, 0.08);
  overflow: hidden;
}

.memory-detail-article-inner {
  position: relative;
  padding: 2.25rem 2.5rem 2rem;
}

.memory-detail-article-inner::before {
  content: "";
  position: absolute;
  top: 1.8rem;
  bottom: 1.8rem;
  left: 1.2rem;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(74, 95, 111, 0.95) 0%, rgba(179, 197, 212, 0.95) 100%);
}

.memory-detail-text {
  margin: 0;
  padding-left: 1.7rem;
  color: var(--memory-text);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.85;
  font-weight: 300;
  white-space: pre-line;
}

.memory-detail-text::first-letter {
  float: left;
  margin: 0.16rem 0.15rem 0 0;
  color: var(--memory-accent);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 2.4rem;
  line-height: 0.86;
  font-weight: 300;
}

.memory-detail-lower {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0 2.5rem 1.6rem;
}

.memory-detail-actions {
  display: flex;
  align-items: center;
}

.memory-detail-remembrance {
  display: flex;
  align-items: flex-end;
  text-align: right;
}

.memory-detail-remember {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(179, 197, 212, 0.95);
  background: rgba(255, 255, 255, 0.86);
  color: var(--memory-text);
  font-size: 0.88rem;
  font-weight: 600;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.memory-detail-remember:hover {
  transform: translateY(-1px);
  border-color: rgba(107, 132, 153, 0.75);
  background: rgba(255, 255, 255, 0.95);
}

.memory-detail-remember.active {
  border-color: rgba(116, 134, 149, 0.82);
  background: rgba(232, 238, 242, 0.96);
  color: #405262;
}

.memory-detail-likes {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--memory-muted);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
}

.memory-detail-likes svg {
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
}

.memory-detail-likes.pulse {
  animation: memory-detail-pulse 0.3s ease-in-out;
}

.memory-detail-footer-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 1rem 0 0.25rem;
  border-top: 1px solid rgba(179, 197, 212, 0.8);
}

.memory-detail-footer-slot {
  min-height: 1.5rem;
}

.memory-detail-footer-center {
  text-align: center;
  color: var(--memory-muted);
  font-size: 0.95rem;
}

.memory-detail-footer-next {
  text-align: right;
}

.memory-detail-nav-link {
  color: var(--memory-text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}

.memory-detail-nav-link:hover {
  color: var(--memory-accent);
}

@keyframes memory-detail-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@media (max-width: 900px) {
  .memory-detail-topbar,
  .memory-detail-meta-row,
  .memory-detail-lower,
  .memory-detail-footer-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .memory-detail-top-actions {
    justify-content: flex-start;
  }

  .memory-detail-attributes {
    justify-content: flex-start;
    white-space: normal;
  }

  .memory-detail-remembrance {
    align-items: flex-start;
    text-align: left;
  }

  .memory-detail-footer-center,
  .memory-detail-footer-next {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .memory-detail-page {
    padding: 0 1rem;
  }

  .memory-detail-article-inner {
    padding: 1.6rem 1.25rem 1.4rem;
  }

  .memory-detail-article-inner::before {
    left: 0.8rem;
    top: 1.2rem;
    bottom: 1.2rem;
  }

  .memory-detail-text {
    padding-left: 1rem;
    font-size: 17px;
  }

  .memory-detail-text::first-letter {
    font-size: 2.1rem;
    margin-right: 0.22rem;
  }

  .memory-detail-lower {
    padding: 0 1.25rem 1.25rem;
  }
}
