:root {
  --bg: #fffaf3;
  --bg-soft: #f8f1f8;
  --surface: rgba(255, 255, 255, 0.68);
  --surface-strong: rgba(255, 255, 255, 0.86);
  --surface-muted: rgba(255, 247, 250, 0.58);
  --ink: #352f36;
  --ink-soft: #5f5362;
  --muted: #827484;
  --rose: #c96f91;
  --rose-soft: #f2bfd0;
  --peach: #eab18b;
  --lavender: #c6b7ee;
  --blue: #a8cbe8;
  --sage: #9db8a5;
  --line: rgba(81, 65, 82, 0.12);
  --line-strong: rgba(129, 91, 113, 0.20);
  --shadow-soft: 0 18px 48px rgba(70, 49, 66, 0.11);
  --shadow-lift: 0 24px 60px rgba(70, 49, 66, 0.16);
  --radius-card: 8px;
  --radius-panel: 18px;
  --header-height: 78px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  width: 100%;
  max-width: 100%;
}

body {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  line-height: 1.7;
  background:
    linear-gradient(180deg, rgba(255, 250, 243, 0.98), rgba(248, 241, 248, 0.94) 48%, rgba(239, 247, 250, 0.96)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0));
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

body.sidebar-open {
  overflow: hidden;
  touch-action: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

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

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

.page-glow {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.62), transparent 48%),
    repeating-linear-gradient(90deg, rgba(201, 111, 145, 0.035) 0 1px, transparent 1px 84px),
    repeating-linear-gradient(0deg, rgba(168, 203, 232, 0.035) 0 1px, transparent 1px 84px);
}

.floating-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.float-item {
  position: absolute;
  color: rgba(201, 111, 145, 0.20);
  font-size: 1.55rem;
  animation: floatDrift 16s ease-in-out infinite;
}

.star {
  color: rgba(113, 142, 188, 0.22);
}

.h1 {
  left: 8%;
  top: 24%;
  animation-delay: -2s;
}

.h2 {
  right: 12%;
  top: 36%;
  animation-delay: -7s;
}

.h3 {
  left: 18%;
  bottom: 12%;
  animation-delay: -10s;
}

.s1 {
  left: 36%;
  top: 15%;
  animation-delay: -4s;
}

.s2 {
  right: 26%;
  bottom: 24%;
  animation-delay: -8s;
}

.s3 {
  right: 7%;
  bottom: 9%;
  animation-delay: -1s;
}

@keyframes floatDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0.30;
  }
  50% {
    transform: translate3d(10px, -24px, 0) rotate(8deg);
    opacity: 0.72;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 18px 0;
}

.mobile-app-header,
.mobile-sidebar,
.mobile-sidebar-overlay {
  display: none;
}

.nav-shell {
  width: min(1120px, 100%);
  min-height: 58px;
  margin: 0 auto;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-panel);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 38px rgba(66, 47, 64, 0.10);
  backdrop-filter: blur(20px) saturate(1.1);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--ink);
  font-weight: 800;
}

.brand-mark {
  width: 64px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.76rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--rose), var(--peach));
  box-shadow: 0 10px 22px rgba(201, 111, 145, 0.22);
}

.brand-text {
  max-width: 180px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-strong);
  cursor: pointer;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  margin: 4px auto;
  display: block;
  border-radius: 999px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-links {
  min-width: 0;
  margin: 0;
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  border-radius: 999px;
  background: rgba(248, 241, 248, 0.76);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
  transition: color 0.22s ease, background 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.nav-link:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  transform: translateY(-1px);
}

.nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--peach));
  box-shadow: 0 10px 22px rgba(201, 111, 145, 0.20);
}

.app-main {
  width: min(1160px, calc(100% - 36px));
  margin: 22px auto 0;
}

.app-page {
  display: none;
  animation: pageReveal 0.32s ease both;
}

.app-page.active-page {
  display: block;
}

.app-page[hidden] {
  display: none !important;
}

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

.section {
  min-height: calc(100vh - var(--header-height));
  padding: 20px 0 34px;
}

.section-panel {
  position: relative;
  min-height: calc(100vh - var(--header-height) - 54px);
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: 18px 0;
}

.section-inner {
  position: relative;
  z-index: 2;
  width: min(1060px, 100%);
  margin: 0 auto;
}

.hero-orbit {
  display: none;
}

.dashboard {
  display: grid;
  gap: 18px;
  align-content: center;
}

.dashboard-hero {
  width: min(760px, 100%);
  margin: 0 auto 8px;
  text-align: center;
}

.eyebrow,
.card-kicker {
  margin: 0 0 10px;
  color: var(--rose);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p,
span,
strong {
  overflow-wrap: break-word;
  word-break: normal;
}

.nav-link,
.drawer-nav-link span,
.drawer-nav-link small {
  overflow-wrap: normal;
  word-break: keep-all;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: 3.6rem;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: 2.1rem;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.16rem;
  line-height: 1.35;
  letter-spacing: 0;
}

h4 {
  margin: 18px 0 8px;
  color: var(--ink);
  font-size: 1rem;
  letter-spacing: 0;
}

.hero-subtitle {
  width: min(660px, 100%);
  margin: 16px auto 22px;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-button,
.secondary-button,
.secondary-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--peach));
  box-shadow: 0 16px 32px rgba(201, 111, 145, 0.22);
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 42px rgba(201, 111, 145, 0.28);
}

.secondary-button,
.secondary-link {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 12px 26px rgba(70, 49, 66, 0.08);
}

.secondary-button:hover,
.secondary-link:hover {
  background: rgba(255, 255, 255, 0.94);
  transform: translateY(-1px);
}

.glass-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-card);
  background: linear-gradient(145deg, var(--surface), var(--surface-muted));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px) saturate(1.08);
}

.name-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 18px;
  color: var(--ink);
  text-align: center;
}

.name-card span {
  min-width: 0;
  color: var(--ink-soft);
  font-size: 1.12rem;
  font-weight: 900;
}

.name-card strong {
  min-width: 0;
  color: var(--rose);
  font-size: 1.72rem;
  line-height: 1.2;
}

.date-grid,
.counter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.date-card,
.counter-card,
.archive-card {
  min-width: 0;
  padding: 22px;
}

.date-card p,
.counter-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 800;
}

.date-card strong {
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1.15;
}

.counter-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.counter-values span {
  min-width: 0;
  padding: 11px 6px 10px;
  border-radius: var(--radius-card);
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.64);
  white-space: nowrap;
}

.counter-values strong {
  display: block;
  color: var(--rose);
  font-size: 1.7rem;
  line-height: 1.05;
}

.counter-message {
  margin: 10px 0 0;
  color: var(--rose);
  font-weight: 800;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.archive-card {
  display: grid;
  align-content: start;
  gap: 10px;
}

.archive-card p {
  margin: 0;
  color: var(--muted);
}

.archive-card h2 {
  font-size: 1.48rem;
}

.intro-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 247, 250, 0.62)),
    linear-gradient(90deg, rgba(201, 111, 145, 0.10), rgba(168, 203, 232, 0.08));
}

.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.mini-stats span,
.dashboard-date,
.diary-date,
.diary-mood,
.timeline-date {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: inset 0 0 0 1px rgba(201, 111, 145, 0.12);
}

.mini-stats strong {
  margin-right: 4px;
  color: var(--ink);
}

.section-heading {
  width: min(760px, 100%);
  margin-bottom: 28px;
}

.section-heading p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.content-message {
  padding: 22px;
  color: var(--ink-soft);
  font-weight: 800;
  text-align: center;
}

.content-warning {
  grid-column: 1 / -1;
  color: var(--muted);
}

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

.diary-card {
  position: relative;
  min-height: 236px;
  padding: 26px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
}

.diary-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.diary-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--rose), var(--lavender), var(--blue), var(--sage));
}

.diary-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.diary-mood:empty {
  display: none;
}

.diary-preview {
  margin: 12px 0 0;
  color: var(--muted);
}

.diary-full {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}

.diary-card.is-open .diary-preview {
  display: none;
}

.diary-card.is-open .diary-full {
  display: block;
}

.diary-toggle {
  position: relative;
  z-index: 2;
  min-height: 36px;
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  padding: 0 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-weight: 900;
  cursor: pointer;
}

.markdown-body {
  color: var(--muted);
}

.markdown-body p {
  margin: 12px 0 0;
}

.markdown-body h3 {
  margin-top: 18px;
}

.markdown-list,
.markdown-checklist {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.markdown-list li {
  position: relative;
  padding-left: 20px;
}

.markdown-list li::before {
  content: "·";
  position: absolute;
  left: 4px;
  color: var(--rose);
  font-size: 1.5rem;
  line-height: 1;
}

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

.photo-card {
  position: relative;
  grid-column: span 4;
  width: 100%;
  aspect-ratio: 3 / 4;
  min-height: 310px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-card);
  appearance: none;
  background: linear-gradient(135deg, #fff2e6, #edf6fb);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  isolation: isolate;
  text-align: left;
  transition: transform 0.26s ease, box-shadow 0.26s ease;
}

.photo-card:nth-child(1),
.photo-card:nth-child(5n) {
  grid-column: span 5;
}

.photo-card:nth-child(3n) {
  grid-column: span 3;
}

.photo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.25s ease;
}

.photo-card:hover img {
  transform: scale(1.045);
}

.photo-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 900;
  background: linear-gradient(135deg, rgba(242, 191, 208, 0.42), rgba(168, 203, 232, 0.34));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.photo-card.image-missing img {
  opacity: 0;
}

.photo-card.image-missing .photo-fallback {
  opacity: 1;
}

.photo-caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-card);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 30px rgba(39, 29, 42, 0.13);
  backdrop-filter: blur(16px);
}

.photo-caption strong,
.photo-caption span {
  display: block;
}

.photo-caption strong {
  line-height: 1.35;
}

.photo-caption span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline {
  position: relative;
  width: min(880px, 100%);
  margin: 0 auto;
  padding: 6px 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(201, 111, 145, 0.52), rgba(168, 203, 232, 0.58), rgba(157, 184, 165, 0.44), transparent);
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 10px 34px 24px;
}

.timeline-item:nth-child(odd) {
  left: 0;
  text-align: right;
}

.timeline-item:nth-child(even) {
  left: 50%;
}

.timeline-dot {
  position: absolute;
  top: 28px;
  width: 16px;
  height: 16px;
  border: 4px solid var(--bg);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--blue));
  box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.48), 0 10px 22px rgba(201, 111, 145, 0.16);
}

.timeline-item:nth-child(odd) .timeline-dot {
  right: -8px;
}

.timeline-item:nth-child(even) .timeline-dot {
  left: -8px;
}

.timeline-card {
  padding: 22px;
}

.timeline-card p {
  margin: 12px 0 0;
  color: var(--muted);
}

.todo-card {
  width: min(820px, 100%);
}

.markdown-checklist {
  gap: 12px;
}

.markdown-task {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-card);
  color: var(--ink);
  font-weight: 800;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(255, 247, 250, 0.56));
  box-shadow: var(--shadow-soft);
}

.task-box {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(201, 111, 145, 0.42);
  border-radius: 50%;
  color: var(--rose);
  background: rgba(255, 255, 255, 0.86);
  font-weight: 900;
}

.markdown-task.checked {
  color: var(--muted);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(238, 246, 240, 0.56));
}

.markdown-task.checked .task-box {
  border-color: rgba(157, 184, 165, 0.76);
  color: #6f9279;
}

.confession-inner {
  display: grid;
  place-items: center;
}

.letter-card {
  position: relative;
  width: min(820px, 100%);
  padding: 44px;
  overflow: hidden;
}

.letter-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(201, 111, 145, 0.12);
  border-radius: var(--radius-card);
  pointer-events: none;
}

.letter-card > * {
  position: relative;
  z-index: 1;
}

.letter-text {
  margin: 22px 0 14px;
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1.85;
  font-weight: 900;
}

.letter-note {
  margin: 0 0 26px;
  color: var(--muted);
}

.confession-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 54px;
}

.hidden-message {
  max-height: 0;
  margin: 0;
  overflow: hidden;
  color: var(--rose);
  font-size: 1.08rem;
  font-weight: 900;
  opacity: 0;
  transition: max-height 0.45s ease, margin 0.45s ease, opacity 0.45s ease;
}

.hidden-message.show {
  max-height: 180px;
  margin-top: 22px;
  opacity: 1;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(48, 39, 49, 0.58);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(16px);
  transition: opacity 0.25s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  width: min(900px, 100%);
  max-height: calc(100vh - 48px);
  margin: 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 30px 80px rgba(38, 30, 44, 0.28);
  transform: scale(0.97);
  transition: transform 0.25s ease;
}

.lightbox.is-open .lightbox-content {
  transform: scale(1);
}

.lightbox-content img {
  width: 100%;
  max-height: 72vh;
  min-height: 240px;
  object-fit: contain;
  background: linear-gradient(135deg, #fff2e6, #edf6fb);
}

.lightbox-content img.image-missing {
  opacity: 0.12;
}

.lightbox-content figcaption {
  padding: 18px 20px 22px;
  color: var(--ink);
  font-weight: 900;
}

.lightbox-content figcaption strong,
.lightbox-content figcaption span {
  display: block;
}

.lightbox-content figcaption span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.92rem;
}

.lightbox-content figcaption p {
  margin: 10px 0 0;
  color: var(--ink-soft);
}

.lightbox-story {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-weight: 500;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 28px rgba(38, 30, 44, 0.16);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.site-footer {
  padding: 24px 20px 36px;
  text-align: center;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.mobile-menu-button,
.mobile-sidebar-close {
  border: 0;
  cursor: pointer;
}

.mobile-menu-button {
  width: 42px;
  height: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.80);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 10px 24px rgba(70, 49, 66, 0.10);
}

.mobile-menu-button span {
  width: 18px;
  height: 2px;
  display: block;
  border-radius: 999px;
  background: var(--ink);
}

.mobile-menu-button span + span {
  margin-top: 0;
}

.mobile-title {
  min-width: 0;
  display: grid;
  line-height: 1.2;
  text-align: center;
}

.mobile-title strong {
  color: var(--ink);
  font-size: 1rem;
}

.mobile-title span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.mobile-header-badge,
.mobile-sidebar-mark {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--rose), var(--peach));
  box-shadow: 0 10px 22px rgba(201, 111, 145, 0.22);
}

.mobile-header-badge {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  font-size: 0.76rem;
}

@media (max-width: 980px) {
  h1 {
    font-size: 3rem;
  }

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

  .intro-card {
    grid-column: 1 / -1;
  }

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

  .photo-card,
  .photo-card:nth-child(1),
  .photo-card:nth-child(3n),
  .photo-card:nth-child(5n) {
    grid-column: span 6;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 66px;
  }

  .site-header {
    display: none;
  }

  .mobile-app-header {
    position: sticky;
    top: 0;
    z-index: 90;
    min-height: var(--header-height);
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 8px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.62);
    background: rgba(255, 250, 246, 0.82);
    box-shadow: 0 12px 30px rgba(70, 49, 66, 0.08);
    backdrop-filter: blur(22px) saturate(1.12);
  }

  .mobile-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 110;
    width: min(78vw, 320px);
    max-width: calc(100vw - 28px);
    height: 100vh;
    height: 100dvh;
    padding: calc(env(safe-area-inset-top, 0px) + 18px) 16px calc(env(safe-area-inset-bottom, 0px) + 20px);
    display: flex;
    flex-direction: column;
    gap: 18px;
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-left: 0;
    border-radius: 0 22px 22px 0;
    background: linear-gradient(145deg, rgba(255, 252, 248, 0.94), rgba(255, 244, 249, 0.86));
    box-shadow: 24px 0 70px rgba(44, 33, 44, 0.22);
    backdrop-filter: blur(26px) saturate(1.12);
    transform: translateX(-104%);
    transition: transform 0.28s ease;
  }

  body.sidebar-open .mobile-sidebar {
    transform: translateX(0);
  }

  .mobile-sidebar-overlay:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: block;
    border: 0;
    padding: 0;
    background: rgba(43, 35, 45, 0.38);
    backdrop-filter: blur(8px);
    cursor: pointer;
  }

  .mobile-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-sidebar-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
  }

  .mobile-sidebar-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 14px;
    font-size: 0.78rem;
  }

  .mobile-sidebar-brand div {
    min-width: 0;
    display: grid;
    line-height: 1.25;
  }

  .mobile-sidebar-brand strong {
    color: var(--ink);
    font-size: 1rem;
    white-space: nowrap;
  }

  .mobile-sidebar-brand span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
  }

  .mobile-sidebar-close {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: inset 0 0 0 1px var(--line-strong);
    font-size: 1.45rem;
    line-height: 1;
  }

  .mobile-sidebar-nav {
    display: grid;
    gap: 8px;
  }

  .drawer-nav-link {
    width: 100%;
    min-height: 54px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: stretch;
    padding: 0 14px;
    border-radius: 14px;
    color: var(--ink-soft);
    text-align: left;
    white-space: normal;
    background: rgba(255, 255, 255, 0.54);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
  }

  .drawer-nav-link:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.76);
  }

  .drawer-nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, var(--rose), var(--peach));
    box-shadow: 0 12px 26px rgba(201, 111, 145, 0.22);
  }

  .drawer-nav-link span,
  .drawer-nav-link small {
    min-width: 0;
  }

  .drawer-nav-link span {
    font-size: 0.98rem;
    font-weight: 900;
  }

  .drawer-nav-link small {
    color: currentColor;
    font-size: 0.76rem;
    font-weight: 800;
    opacity: 0.72;
  }

  .app-main {
    width: min(100%, calc(100vw - 20px));
    margin-top: 8px;
    overflow: hidden;
  }

  .section {
    min-height: auto;
    padding: 8px 0 calc(env(safe-area-inset-bottom, 0px) + 84px);
  }

  .section-panel {
    min-height: auto;
    padding: 10px 0 18px;
    overflow: visible;
  }

  .section-inner,
  .dashboard,
  .dashboard > *,
  .glass-card,
  .archive-card,
  .date-card,
  .counter-card {
    max-width: 100%;
    min-width: 0;
  }

  .dashboard {
    gap: 12px;
  }

  .dashboard-hero {
    width: min(100%, 520px);
    margin-bottom: 2px;
    padding: 18px 14px;
    border: 1px solid rgba(255, 255, 255, 0.70);
    border-radius: var(--radius-card);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.64), rgba(255, 247, 250, 0.42));
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px) saturate(1.08);
  }

  h1 {
    font-size: clamp(2rem, 9vw, 2.45rem);
    line-height: 1.08;
  }

  h2 {
    font-size: clamp(1.36rem, 6vw, 1.62rem);
  }

  h3 {
    font-size: 1.04rem;
  }

  .eyebrow,
  .card-kicker {
    font-size: 0.68rem;
  }

  .hero-subtitle {
    margin: 12px auto 16px;
    font-size: 0.96rem;
    line-height: 1.65;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .primary-button,
  .secondary-button,
  .secondary-link {
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
  }

  .name-card,
  .date-grid,
  .counter-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .name-card {
    gap: 8px;
    padding: 14px;
  }

  .name-card strong {
    order: -1;
    font-size: clamp(1.16rem, 6vw, 1.46rem);
  }

  .name-card span {
    font-size: 0.94rem;
  }

  .date-card,
  .counter-card,
  .archive-card {
    padding: 15px;
  }

  .date-card strong {
    font-size: 1.34rem;
  }

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

  .counter-values span {
    padding: 9px 4px 8px;
    font-size: 0.78rem;
  }

  .counter-values strong {
    font-size: clamp(1.18rem, 6vw, 1.44rem);
  }

  .mini-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mini-stats span {
    width: 100%;
    justify-content: center;
    padding-inline: 6px;
    text-align: center;
  }

  .section-heading {
    margin-bottom: 18px;
  }

  .section-heading p:last-child {
    font-size: 0.96rem;
  }

  .diary-card {
    min-height: auto;
    padding: 20px;
  }

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

  .photo-card,
  .photo-card:nth-child(1),
  .photo-card:nth-child(3n),
  .photo-card:nth-child(5n) {
    grid-column: auto;
    min-height: 300px;
  }

  .timeline::before {
    left: 12px;
  }

  .timeline-item,
  .timeline-item:nth-child(even),
  .timeline-item:nth-child(odd) {
    left: 0;
    width: 100%;
    padding: 8px 0 18px 38px;
    text-align: left;
  }

  .timeline-item:nth-child(odd) .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot {
    left: 4px;
    right: auto;
  }

  .timeline-card {
    padding: 18px;
  }

  .letter-card {
    padding: 30px 22px;
  }

  .letter-card::before {
    inset: 10px;
  }

  .letter-text {
    font-size: 1.16rem;
  }

  .confession-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .lightbox {
    padding: 14px;
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 2.05rem;
  }

  .counter-values span {
    padding-inline: 4px;
  }

  .photo-card {
    min-height: 300px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
