:root {
  --bg: #0d0b1f;
  --bg-2: #12102a;
  --text: #f2f0ff;
  --muted: rgba(242, 240, 255, .66);
  --purple: #b18bff;
  --cyan: #7be0ff;
  --pink: #ff9ecb;
  --lime: #dfff4f;
  --glass: rgba(255, 255, 255, .085);
  --line: rgba(255, 255, 255, .22);
  --shadow: 0 24px 80px rgba(0, 0, 0, .42);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(177, 139, 255, .34), transparent 34rem),
    radial-gradient(circle at 84% 12%, rgba(123, 224, 255, .26), transparent 32rem),
    radial-gradient(circle at 72% 78%, rgba(255, 158, 203, .28), transparent 34rem),
    linear-gradient(145deg, var(--bg), var(--bg-2) 48%, #080714);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.72), transparent 86%);
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.aurora {
  position: fixed;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(circle, rgba(123,224,255,.18), transparent 28%),
    radial-gradient(circle at 65% 25%, rgba(255,158,203,.18), transparent 24%),
    radial-gradient(circle at 35% 70%, rgba(177,139,255,.2), transparent 26%);
  filter: blur(30px) saturate(1.4);
  animation: drift 48s ease-in-out infinite alternate;
}

.site-header {
  position: sticky;
  top: 16px;
  z-index: 20;
  width: min(1120px, calc(100% - 32px));
  margin: 16px auto 0;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 999px;
}

.brand,
.hero h1,
.section-heading h2 {
  letter-spacing: -.06em;
  background: linear-gradient(120deg, #fff 4%, var(--cyan) 34%, var(--pink) 64%, var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 34px rgba(177, 139, 255, .28);
}

.brand {
  font-size: 1.2rem;
  font-weight: 900;
}

.nav-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255,255,255,.1);
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 36px auto 90px;
}

.glass,
.panel,
.hero {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.045));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.16);
  backdrop-filter: blur(16px);
}

.hero,
.panel {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  margin-bottom: 22px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease, box-shadow .25s ease;
}

.hero.is-visible,
.panel.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero::after,
.panel::after {
  content: "✦";
  position: absolute;
  right: 24px;
  top: 16px;
  color: rgba(255,255,255,.45);
  text-shadow: 0 0 22px var(--cyan);
  animation: twinkle 2.4s ease-in-out infinite;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: center;
  min-height: 420px;
  padding: clamp(24px, 5vw, 56px);
}

.hero h1 {
  max-width: 760px;
  margin: 10px 0 18px;
  font-size: clamp(3rem, 10vw, 7.8rem);
  line-height: .88;
  font-weight: 950;
}

.hero h1 span {
  display: block;
}

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

.eyebrow {
  margin: 0;
  color: var(--lime);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.hero-actions,
.button-row,
.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button,
.mini-button {
  border: 1px solid rgba(255,255,255,.2);
  color: var(--text);
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  font-weight: 800;
}

.button:hover,
.mini-button:hover,
.chip:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.44);
  box-shadow: 0 0 30px rgba(123,224,255,.2);
}

.button.primary {
  color: #15151c;
  border: 0;
  background: linear-gradient(135deg, var(--lime), var(--cyan) 48%, var(--pink));
  box-shadow: 0 0 34px rgba(223,255,79,.34);
}

.button.ghost {
  background: rgba(255,255,255,.075);
}

.panel {
  padding: clamp(20px, 4vw, 36px);
}

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

.section-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.meal-form {
  display: grid;
  grid-template-columns: 160px 140px minmax(220px, 1fr);
  gap: 14px;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .92rem;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(5,5,18,.5);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(123,224,255,.14);
}

.meal-form .button-row {
  grid-column: 1 / -1;
}

.quick-pool,
.menu-cloud,
.meal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-pool {
  margin-top: 18px;
}

.chip,
.meal-tag,
.menu-pill {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--text);
  background: rgba(255,255,255,.085);
}

.meal-tag,
.menu-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.meal-tag button,
.menu-pill button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255,255,255,.12);
}

.timeline-list {
  display: grid;
  gap: 16px;
}

.day-card,
.empty-card,
.photo-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 24px;
  padding: 18px;
  background: rgba(255,255,255,.07);
}

.day-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.day-head h3 {
  margin: 4px 0 0;
  font-size: 1.55rem;
}

.mood,
.muted {
  color: var(--muted);
}

.day-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.thumb,
.photo-button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255,255,255,.1);
}

.thumb img,
.photo-button img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform .3s ease, filter .3s ease;
}

.thumb:hover img,
.photo-button:hover img {
  transform: scale(1.06);
  filter: saturate(1.2) brightness(1.08);
}

.day-stickers span {
  position: absolute;
  left: calc(var(--x) * 100%);
  top: calc(var(--y) * 100%);
  font-size: calc(2rem * var(--scale));
  transform: translate(-50%, -50%) rotate(var(--rot));
  filter: drop-shadow(0 0 12px rgba(255,158,203,.75));
  pointer-events: none;
}

.gallery-tools,
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.photo-card {
  padding: 10px;
}

.photo-card div {
  display: grid;
  gap: 8px;
  padding: 10px 2px 0;
  color: var(--muted);
  font-size: .88rem;
}

.mini-button {
  min-height: 32px;
  padding: 6px 10px;
}

.inline-form input {
  min-width: min(320px, 100%);
}

.file-label {
  position: relative;
  overflow: hidden;
}

.file-label input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.mascot {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.mascot-orb {
  display: grid;
  place-items: center;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 48% 52% 45% 55%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.52), transparent 16%),
    linear-gradient(145deg, rgba(123,224,255,.26), rgba(255,158,203,.16));
  box-shadow: 0 0 46px rgba(177,139,255,.35);
  animation: floaty 4s ease-in-out infinite;
}

.mascot img {
  max-width: 150px;
  max-height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(123,224,255,.65));
}

.mascot-fallback {
  font-size: 5rem;
  filter: drop-shadow(0 0 22px rgba(255,158,203,.8));
}

.speech {
  max-width: 220px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  color: var(--text);
  background: rgba(255,255,255,.09);
  line-height: 1.55;
}

.sticker-shelf {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 36px);
  padding: 10px;
  border-radius: 999px;
}

.sticker-shelf span {
  color: var(--muted);
  font-size: .82rem;
}

.sticker-shelf button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.1);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  color: var(--text);
  background: rgba(14, 12, 32, .88);
  box-shadow: 0 0 28px rgba(123,224,255,.22);
  opacity: 0;
  transform: translate(-50%, 20px);
  transition: opacity .2s ease, transform .2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(3, 3, 12, .82);
  backdrop-filter: blur(16px);
}

.lightbox[aria-hidden="false"] {
  display: grid;
}

.lightbox figure {
  width: min(920px, 100%);
  margin: 0;
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  margin: 0 auto;
  border-radius: 24px;
  box-shadow: 0 0 60px rgba(177,139,255,.36);
}

.lightbox figcaption {
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255,255,255,.1);
}

.lightbox-close {
  right: 24px;
  top: 24px;
  width: 44px;
  height: 44px;
  font-size: 1.6rem;
}

.lightbox-nav {
  top: 50%;
  width: 54px;
  height: 54px;
  font-size: 2.4rem;
  transform: translateY(-50%);
}

.lightbox-nav.prev {
  left: 24px;
}

.lightbox-nav.next {
  right: 24px;
}

.sparkle-pop {
  position: fixed;
  z-index: 80;
  color: var(--lime);
  pointer-events: none;
  text-shadow: 0 0 12px var(--cyan);
  animation: pop .85s ease forwards;
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) rotate(0deg); }
  to { transform: translate3d(2%, 1%, 0) rotate(6deg); }
}

@keyframes twinkle {
  0%, 100% { opacity: .34; transform: scale(.9) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.1) rotate(18deg); }
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

@keyframes pop {
  to {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(1.8) rotate(60deg);
  }
}

@media (max-width: 780px) {
  .site-header,
  .page-shell {
    width: min(100% - 20px, 1120px);
  }

  .nav {
    align-items: flex-start;
    border-radius: 22px;
    flex-direction: column;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .meal-form {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .sticker-shelf {
    left: 10px;
    right: 10px;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
