:root {
  --pink: #ff8fba;
  --rose: #ff5f9d;
  --cream: #fff7fb;
  --ink: #49313d;
  --blue: #8fd3ff;
  --mint: #9be8cf;
  --shadow: 0 18px 50px rgba(255, 95, 157, .22);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Nunito", "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 15% 8%, rgba(143, 211, 255, .4), transparent 26rem),
    radial-gradient(circle at 85% 12%, rgba(155, 232, 207, .36), transparent 22rem),
    linear-gradient(135deg, #fff7fb, #ffe8f2 55%, #f8fbff);
  min-height: 100vh;
}

.app { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 56px; }
.hidden { display: none !important; }

.lock {
  min-height: 86vh;
  display: grid;
  place-items: center;
  text-align: center;
}
.lock > * { grid-column: 1; }
.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 132px;
  height: 132px;
  border-radius: 38% 62% 54% 46%;
  color: white;
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--rose), #ffb4cf);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.logo img {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  filter: drop-shadow(0 5px 10px rgba(73, 49, 61, .2));
}
.logo.small {
  width: auto;
  height: auto;
  display: inline-flex;
  border-radius: 0;
  background: none;
  color: var(--rose);
  box-shadow: none;
  margin: 0 0 4px;
  font-size: 18px;
}
.logo.small::before {
  content: "";
  width: 25px;
  height: 25px;
  border-radius: 9px;
  background: url("/favicon.svg") center / cover no-repeat;
  box-shadow: 0 6px 14px rgba(255, 95, 157, .22);
}
h1 { margin: 0; font-size: clamp(28px, 6vw, 56px); letter-spacing: 0; }
p { margin: 14px 0 22px; font-size: 18px; opacity: .76; }
.pin-box {
  display: flex;
  gap: 10px;
  justify-content: center;
  width: min(420px, 100%);
}
input, textarea, select, button {
  font: inherit;
  border: 0;
}
input, textarea, select {
  background: rgba(255,255,255,.82);
  color: var(--ink);
  border: 1px solid rgba(255, 95, 157, .18);
  outline: none;
}
.pin-box input {
  flex: 1;
  min-width: 0;
  padding: 15px 16px;
  border-radius: 999px;
}
button, .file-btn {
  cursor: pointer;
  color: white;
  background: linear-gradient(135deg, var(--rose), var(--pink));
  box-shadow: 0 10px 24px rgba(255, 95, 157, .25);
  border-radius: 999px;
  padding: 13px 20px;
  font-weight: 800;
  white-space: nowrap;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  backdrop-filter: blur(16px);
}
.topbar h1 { font-size: clamp(28px, 5vw, 44px); }
.spark {
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(255, 95, 157, .16);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  color: var(--rose);
}

.composer {
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(255, 95, 157, .16);
  box-shadow: var(--shadow);
  border-radius: 28px;
  padding: 16px;
  margin: 10px 0 24px;
}
textarea {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  padding: 15px;
  border-radius: 20px;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}
.file-btn input { display: none; }
select { padding: 13px 14px; border-radius: 999px; }
.preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 24px;
  max-height: 520px;
  overflow-y: auto;
  background: white;
  padding: 10px;
}
.preview img, .preview video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  display: block;
}

.masonry {
  column-count: 4;
  column-gap: 18px;
}
.card {
  break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin: 0 0 18px;
  overflow: hidden;
  border-radius: 28px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 14px 34px rgba(73, 49, 61, .12);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 48px rgba(255, 95, 157, .24);
}
.card img, .card video {
  width: 100%;
  display: block;
}
.card-body { padding: 14px 15px 16px; }
.card-text { white-space: pre-wrap; line-height: 1.65; }
.date { margin-top: 10px; font-size: 12px; opacity: .58; }
.delete {
  float: right;
  padding: 8px 10px;
  font-size: 12px;
  background: rgba(255, 95, 157, .12);
  color: var(--rose);
  box-shadow: none;
}

.filter-soft { filter: saturate(1.08) contrast(.98) brightness(1.05) sepia(.08); }
.filter-film { filter: contrast(1.08) saturate(.9) sepia(.18); }
.filter-dream { filter: saturate(1.2) hue-rotate(-8deg) brightness(1.08); }
.filter-peach { filter: saturate(1.15) sepia(.16) hue-rotate(-12deg) brightness(1.06); }
.filter-candy { filter: saturate(1.35) contrast(1.04) hue-rotate(-18deg) brightness(1.04); }
.filter-latte { filter: sepia(.28) saturate(.88) contrast(1.02) brightness(1.03); }
.filter-aqua { filter: saturate(1.12) hue-rotate(18deg) brightness(1.06); }
.filter-sunny { filter: saturate(1.18) contrast(1.02) brightness(1.12) sepia(.08); }
.filter-berry { filter: saturate(1.25) hue-rotate(-28deg) contrast(1.06); }
.filter-mono { filter: grayscale(1) contrast(1.08); }

.card img,
.card video {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(73, 49, 61, .68);
  backdrop-filter: blur(18px);
}
.lightbox-media {
  max-width: min(1080px, 94vw);
  max-height: 82vh;
  display: grid;
  place-items: center;
}
.lightbox-media img,
.lightbox-media video {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 24px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .32);
  background: white;
  transition: transform .12s ease-out;
  transform-origin: center center;
}
.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .18);
}
.lightbox-caption {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  max-width: min(720px, calc(100% - 36px));
  color: white;
  text-align: center;
  line-height: 1.7;
  white-space: pre-wrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

@media (max-width: 980px) { .masonry { column-count: 3; } }
@media (max-width: 720px) {
  .app { width: min(100% - 18px, 1180px); padding-top: 12px; }
  .pin-box { flex-direction: column; }
  .topbar { padding: 12px 0; }
  .spark { display: none; }
  .masonry { column-count: 2; column-gap: 12px; }
  .card { border-radius: 22px; margin-bottom: 12px; }
  .composer { border-radius: 24px; padding: 12px; }
  .controls > * { flex: 1; text-align: center; }
  .preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lightbox { padding: 12px; }
  .lightbox-media img,
  .lightbox-media video { border-radius: 18px; }
}
@media (max-width: 430px) { .masonry { column-count: 1; } }
