/* ===== reset & base ===== */
body {
  font-family: "Microsoft YaHei", "Comic Sans MS", cursive, sans-serif;
  background: #fff5e6;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}
body.is-transitioning {
  overflow: hidden;
  height: 100vh;
}

.view-layer { will-change: transform, opacity; }

/* ===== vertical page transitions ===== */
.slide-enter-from-bottom {
  animation: slide-enter-bottom 0.55s cubic-bezier(0.34, 0.02, 0.4, 1) forwards;
}
.slide-exit-to-top {
  animation: slide-exit-top 0.55s cubic-bezier(0.34, 0.02, 0.4, 1) forwards;
  pointer-events: none;
}
.slide-active {
  position: fixed !important;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10;
  margin: 0 !important;
  border-radius: 0 !important;
}

@keyframes slide-enter-bottom {
  from { transform: translateY(100vh); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes slide-exit-top {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(-100vh); opacity: 0; }
}

/* ===== auth gate ===== */
.auth-gate {
  min-height: 100vh; width: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; box-sizing: border-box;
  background: linear-gradient(160deg, #fff5eb 0%, #fde8d0 50%, #fbd5b5 100%);
}
.auth-card {
  width: 100%; max-width: 360px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(180, 100, 50, .18);
  padding: 28px 24px; box-sizing: border-box;
}
.auth-title {
  margin: 0 0 16px; font-size: 20px;
  color: #6b3e26; text-align: center; font-weight: 700;
}
.auth-input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid #e8d5c4;
  border-radius: 12px; font-size: 15px; box-sizing: border-box; outline: none;
  background: #fffaf5;
  transition: border-color .2s, box-shadow .2s;
}
.auth-input:focus {
  border-color: #ff7b6a;
  box-shadow: 0 0 0 3px rgba(255, 123, 106, .18);
}
.auth-error {
  margin-top: 10px; min-height: 18px; text-align: center;
  color: #dc2626; font-size: 13px;
}

/* ===== birthday stage ===== */
.birthday-stage {
  min-height: 100vh; width: 100%;
  display: none; align-items: center; justify-content: center;
  background: radial-gradient(circle at top, #fef3c7, #fde68a 45%, #f59e0b);
  padding: 24px; box-sizing: border-box;
  position: relative; overflow: hidden;
}
.birthday-inner {
  width: 100%; max-width: 780px; min-height: 72vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative;
}
.birthday-title {
  margin: 0 0 22px; font-size: 56px; line-height: 1.1; color: #7c2d12;
  text-shadow: 0 8px 18px rgba(124,45,18,.22);
  animation: birthday-float 2.2s ease-in-out infinite;
  transition: opacity .5s ease; text-align: center;
}
.birthday-title.hidden { opacity: 0; pointer-events: none; }
@keyframes birthday-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.gift-wrap {
  position: relative; width: 220px; height: 190px; cursor: pointer;
  z-index: 3;
}
.gift-lid {
  position: absolute; left: 10px; top: 10px;
  width: 200px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  box-shadow: 0 8px 16px rgba(127,29,29,.28);
  transform-origin: 18px 38px;
  transition: transform .6s cubic-bezier(.34, 1.2, .55, 1), opacity .5s ease;
  z-index: 4;
}
.gift-wrap.opened .gift-lid {
  transform: translateY(-120vh) rotate(-35deg);
  opacity: 0;
}
.gift-box {
  position: absolute; left: 0; bottom: 0;
  width: 220px; height: 150px; border-radius: 14px;
  background: linear-gradient(135deg, #f97316, #fb923c);
  box-shadow: 0 14px 26px rgba(124,45,18,.35);
  transition: transform .6s cubic-bezier(.34, 1.2, .55, 1), opacity .5s ease;
}
.gift-wrap.opened .gift-box {
  transform: translateY(120vh);
  opacity: 0;
}
.gift-ribbon-v {
  position: absolute; left: 50%; top: 0; width: 26px; height: 100%;
  transform: translateX(-50%); background: #fde68a; opacity: .95;
  transition: opacity .3s ease;
}
.gift-ribbon-h {
  position: absolute; left: 0; top: 52px; width: 100%; height: 22px;
  background: #fde68a; opacity: .95;
  transition: opacity .3s ease;
}
.gift-wrap.opened .gift-ribbon-v,
.gift-wrap.opened .gift-ribbon-h {
  opacity: 0;
}

/* ===== birthday photos container (fixed fullscreen) ===== */
.birthday-photos {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

/* ===== birthday photo base style ===== */
.birthday-photo {
  pointer-events: none;
  opacity: 0;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(17,24,39,.35);
  display: block;
}

/* ===== fireworks ===== */
.firework-particle {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  z-index: 50;
  animation: firework-burst 1s cubic-bezier(.25, .1, .25, 1) forwards;
}
@keyframes firework-burst {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--fx), var(--fy)) scale(0); opacity: 0; }
}

/* ===== sparkle ===== */
.sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 50;
  animation: sparkle-glow 1.2s ease-out forwards;
}
@keyframes sparkle-glow {
  0%   { transform: translate(0,0) scale(0); opacity: 1; }
  50%  { transform: translate(var(--sx), var(--sy)) scale(1.2); opacity: 1; }
  100% { transform: translate(var(--sx), var(--sy)) scale(0); opacity: 0; }
}

/* ===== scroll arrow ===== */
.scroll-arrow {
  position: absolute; bottom: 16px; left: 50%;
  transform: translateX(-50%);
  display: none; flex-direction: column; align-items: center; gap: 0;
  cursor: pointer; z-index: 20; padding: 12px 20px;
  opacity: 0; transition: opacity .6s ease;
}
.birthday-stage.can-enter .scroll-arrow { display: flex; opacity: 1; }
.scroll-arrow:hover { opacity: .9 !important; }
.scroll-arrow-chevron {
  display: block; width: 18px; height: 18px;
  border-right: 2.5px solid rgba(255,255,255,.75);
  border-bottom: 2.5px solid rgba(255,255,255,.75);
  animation: arrow-bounce 1.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.scroll-arrow-chevron:last-child { margin-top: -8px; animation-delay: .2s; }
@keyframes arrow-bounce {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  40%      { transform: rotate(45deg) translateY(10px); }
  60%      { transform: rotate(45deg) translateY(8px); }
}

/* ===== top navigation ===== */
.layout {
  min-height: 100vh;
  padding-top: 60px;
  box-sizing: border-box;
}
.top-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  background: #fff0e0;
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 60px;
  box-shadow: 0 2px 16px rgba(107, 62, 38, .08);
  box-sizing: border-box;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.nav-left {
  font-size: 16px;
  font-weight: 700;
  color: #ff7b6a;
  white-space: nowrap;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  padding: 8px 14px;
  font-size: 13px;
  color: #6b3e26;
  text-decoration: none;
  cursor: pointer;
  border-radius: 8px;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.nav-link:hover { background: rgba(255, 123, 106, .08); }
.nav-link.active {
  color: #ff7b6a;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

/* ===== main content ===== */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}
.section-container {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(120, 70, 40, .08);
  padding: 28px;
}
.section-container h1 {
  font-size: 20px; margin: 0 0 4px; color: #6b3e26;
}
.section-container p.sub {
  margin: 0 0 20px; color: #a0806a; font-size: 13px;
}

/* ===== home section ===== */
.home-section {
  display: block;
}

/* ===== hero carousel (Cover Flow) ===== */

.hero-carousel-wrapper {
  overflow: hidden;
  border-radius: 16px;
  background: #ede0d0;
  box-shadow: 0 8px 28px rgba(120, 70, 40, .12);
  margin-bottom: 32px;
}

.hero-carousel {
  position: relative;
  width: 100%;
  height: 500px;
  padding: 20px 0;
}

.hero-carousel .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  background: transparent;
}

.carousel-card {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-card img {
  max-width: 83%;
  max-height: 83%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  transition: opacity 0.4s ease, filter 0.4s ease;
}

/* side slides — dimmed */
.hero-carousel .swiper-slide-prev .carousel-card img,
.hero-carousel .swiper-slide-next .carousel-card img {
  opacity: 0.55;
  filter: brightness(0.55);
}

/* far slides — darker and more transparent */
.hero-carousel .swiper-slide:not(.swiper-slide-active):not(.swiper-slide-prev):not(.swiper-slide-next) .carousel-card img {
  opacity: 0.25;
  filter: brightness(0.25);
}

/* active slide — full height allows landscape images to match portrait height */
.hero-carousel .swiper-slide-active .carousel-card img {
  max-height: 90%;
  max-width: none;
}

/* ---- Custom navigation arrows ---- */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border: none; border-radius: 999px;
  background: rgba(255,255,255,.85);
  color: #6b3e26;
  font-size: 24px; line-height: 44px;
  cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .15s, opacity .15s;
  box-shadow: 0 4px 14px rgba(100, 60, 30, .15);
  z-index: 20;
  display: flex;
  align-items: center;  justify-content: center;
  user-select: none;
}
.carousel-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.1); box-shadow: 0 6px 20px rgba(100, 60, 30, .25); }
.carousel-arrow:active { transform: translateY(-50%) scale(0.95); }
.carousel-arrow-left { left: 10px; }
.carousel-arrow-right { right: 10px; }
.carousel-arrow.swiper-button-disabled { opacity: 0; pointer-events: none; }

/* ---- Pagination dots ---- */
.hero-carousel .swiper-pagination {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
  width: auto;
}
.hero-carousel .swiper-pagination-bullet {
  width: 8px; height: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(107, 62, 38, .3);
  opacity: 1;
  margin: 0;
  transition: background .25s, transform .2s;
}
.hero-carousel .swiper-pagination-bullet-active {
  background: #ff7b6a;
  transform: scale(1.35);
}

/* ===== two column layout ===== */
.home-columns {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* ===== moments grid (left column) ===== */
.moments-section {
  flex: 2;
  min-width: 0;
}
.moments-title {
  text-align: left;
}
.moments-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.moments-grid-item {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(120, 70, 40, .1);
  transition: transform .2s, box-shadow .2s;
}
.moments-grid-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(120, 70, 40, .18);
}
.moments-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
      border-radius: 14px;  display: block;
}
.moments-empty {
  grid-column: 1 / -1;
  padding: 40px 16px;
  text-align: center;
  color: #a0806a;
  font-size: 14px;
  background: #fffaf5;
  border-radius: 10px;
  border: 1.5px dashed #e8d5c4;
}

/* ===== counter section (right column) ===== */
.counter-section {
  flex: 1;
  min-width: 200px;
  background: linear-gradient(135deg, #fff0e0, #fff5e6);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(255, 123, 106, .08);
}
.counter-section .section-title {
  font-size: 24px;
  margin: 0 0 16px;
}
.counter-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}
.counter-number {
  font-size: 52px;
  font-weight: 800;
  color: #ff7b6a;
  line-height: 1;
  font-family: "Comic Sans MS", cursive;
}
.counter-unit {
  font-size: 22px;
  color: #6b3e26;
  font-weight: 700;
}
.counter-start-date {
  font-size: 14px;
  color: #a0806a;
  margin-bottom: 16px;
}
.counter-decoration-img {
  max-width: 100px;
  border-radius: 10px;
  margin-top: 12px;
  box-shadow: 0 4px 12px rgba(120, 70, 40, .1);
}

/* ===== section title ===== */
.section-title {
  font-size: 24px;
  font-weight: 700;
  color: #6b3e26;
  margin: 0 0 16px;
  text-align: center;
  font-family: "Microsoft YaHei", cursive, sans-serif;
  position: relative;
  padding-bottom: 10px;
}
.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: #ff7b6a;
  border-radius: 2px;
}

/* ===== common ===== */
.flex-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flex-col { display: flex; flex-direction: column; }

/* ===== upload ===== */
.upload-area {
  border: 2px dashed #e8d5c4; border-radius: 12px; padding: 24px;
  text-align: center; transition: border-color .2s, background-color .2s;
  background-color: #fffaf5;
}
.upload-area.dragover { border-color: #ff7b6a; background-color: #fff3e6; }
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-text { font-size: 14px; color: #6b4f3a; }
.upload-text span { color: #ff7b6a; font-weight: 600; cursor: pointer; }
input[type="file"] { display: none; }

.btn-primary {
  margin-top: 16px; width: 100%; padding: 10px 16px; border-radius: 10px;
  border: none; background: #ff7b6a;
  color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform .12s cubic-bezier(.34, 1.4, .64, 1),
              box-shadow .12s ease, opacity .2s;
  box-shadow: 0 6px 16px rgba(255, 123, 106, .3);
}
.btn-primary:disabled { opacity: .5; cursor: default; box-shadow: none; }
.btn-primary:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(255, 123, 106, .4);
}
.btn-primary:not(:disabled):active { transform: translateY(0); }

.btn-auto  { width: auto; margin-top: 0; }
.btn-pill  { border-radius: 999px; box-shadow: none; }
.btn-sm    { width: auto; padding: 6px 14px; margin-top: 0; }

.preview { margin-top: 20px; text-align: center; }
.preview img {
  max-width: 100%; max-height: 260px; border-radius: 12px;
  box-shadow: 0 10px 20px rgba(120, 70, 40, .14); object-fit: contain;
      border-radius: 14px;}
.status { margin-top: 12px; font-size: 13px; text-align: center; }
.status.success { color: #16a34a; }
.status.error   { color: #dc2626; }
.status a { color: #ff7b6a; text-decoration: none; }
.status a:hover { text-decoration: underline; }

/* ===== gallery management grid ===== */
.gallery-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.gallery-header h1 { margin: 0; font-size: 18px; }
.gallery {
  margin-top: 8px; max-height: 400px; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px;
}
.gallery-item { position: relative; }
.gallery-item img {
  width: 100%; height: 80px; object-fit: contain; border-radius: 8px; cursor: pointer;
      border-radius: 14px;  transition: transform .15s cubic-bezier(.34, 1.4, .64, 1), box-shadow .15s ease;
  box-shadow: 0 4px 10px rgba(120, 70, 40, .12);
}
.gallery-item img:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 18px rgba(120, 70, 40, .18);
}
.delete-btn {
  position: absolute; right: -8px; top: -16px;
  border: none; border-radius: 999px; padding: 0;
  width: 14px; height: 14px; font-size: 11px; line-height: 14px;
  background: rgba(239,68,68,.96); color: #fff; cursor: pointer;
  box-shadow: 0 4px 10px rgba(239,68,68,.4);
  opacity: 0; pointer-events: none; transition: opacity .12s ease;
}
.delete-btn:hover { background: rgba(220,38,38,1); }
.gallery-item:hover .delete-btn { opacity: 1; pointer-events: auto; }

.category-select {
  position: absolute; left: 6px; bottom: 6px;
  max-width: calc(100% - 12px); padding: 2px 6px; font-size: 11px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.65);
  background: rgba(60, 35, 20, .72); color: #fff; outline: none;
  opacity: 0; pointer-events: none; transition: opacity .12s ease;
}
.gallery-item:hover .category-select { opacity: 1; pointer-events: auto; }

.gallery-management {
  margin-top: 16px;
}

/* ===== categories ===== */
#categoryList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px;
}
#categoryGallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.cat-card {
  border: 1px solid #e8d5c4; background: #fff; border-radius: 12px;
  padding: 10px; display: flex; flex-direction: column; gap: 6px; cursor: pointer;
  min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
.cat-card:hover { border-color: #ffd6b3; box-shadow: 0 4px 12px rgba(255, 123, 106, .08); }
.cat-card-title { font-size: 14px; font-weight: 700; color: #6b3e26; }
.cat-card-sub   { font-size: 12px; color: #a0806a; }
.cat-card-actions { display: flex; align-items: center; gap: 8px; font-size: 11px; margin-top: 4px; }

.badge-btn {
  border: none; border-radius: 999px; padding: 3px 10px;
  cursor: pointer; font-size: 11px; margin-top: 0;
  box-shadow: none; transition: opacity .12s;
}
.badge-btn:hover { opacity: .8; }
.badge-btn--rename { background: #fef3c7; color: #c2410c; }
.badge-btn--delete { background: #fee2e2; color: #b91c1c; }

.input-text {
  padding: 8px 10px; border-radius: 8px; border: 1.5px solid #e8d5c4; font-size: 13px;
  outline: none; transition: border-color .2s; background: #fffaf5;
}
.input-text:focus { border-color: #ff7b6a; }
.select-sm {
  padding: 4px 8px; border-radius: 8px; border: 1.5px solid #e8d5c4; font-size: 13px;
  outline: none; background: #fffaf5;
}
.select-sm:focus { border-color: #ff7b6a; }

/* ===== places ===== */
.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.place-card {
  background: #fffaf5;
  border: 1.5px solid #ffd6b3;
  border-radius: 14px;
  padding: 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.place-card:hover { border-color: #ff7b6a; box-shadow: 0 4px 14px rgba(255, 123, 106, .1); }
.place-card-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.place-card-icon { font-size: 20px; flex-shrink: 0; }
.place-card-name {
  font-size: 14px; font-weight: 600; color: #6b3e26;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.place-card .delete-btn {
  position: static; flex-shrink: 0;
  width: 20px; height: 20px; font-size: 14px; line-height: 20px;
  opacity: 0.5; pointer-events: auto; box-shadow: none;
  background: transparent; color: #b91c1c;
}
.place-card:hover .delete-btn { opacity: 0.8; }
.place-card .delete-btn:hover { opacity: 1; background: transparent; }

.places-empty {
  margin-top: 16px;
  padding: 32px 16px; text-align: center;
  color: #a0806a; font-size: 14px;
  background: #fffaf5; border-radius: 12px;
  border: 1.5px dashed #e8d5c4;
}

/* ===== map modal ===== */
.map-overlay {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(30, 15, 5, .55);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  padding: 24px; box-sizing: border-box;
}
.map-overlay.show { display: flex; }
.map-box {
  background: #fff; border-radius: 20px; padding: 20px;
  width: 100%; max-width: 640px;
  box-shadow: 0 24px 48px rgba(60, 30, 15, .3);
  animation: map-enter .35s cubic-bezier(.34, 1.2, .55, 1) forwards;
}
@keyframes map-enter {
  from { transform: scale(.92) translateY(16px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.map-box-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.map-box-title { font-size: 16px; font-weight: 700; color: #6b3e26; }
.map-close-btn {
  width: 32px; height: 32px; border: none; background: #f3eee9;
  border-radius: 999px; font-size: 18px; line-height: 32px;
  text-align: center; cursor: pointer; color: #6b4f3a;
  transition: background .12s;
}
.map-close-btn:hover { background: #e8d5c4; }
.map-body { display: flex; gap: 16px; }
.map-body-left { flex: 2; min-width: 0; }
.map-body-right {
  flex: 1; min-width: 160px;
  display: flex; flex-direction: column; gap: 8px;
}
.map-frame {
  width: 100%; height: 380px; border-radius: 12px;
  border: 1px solid #e8d5c4; overflow: hidden;
}
.map-frame iframe { width: 100%; height: 100%; border: 0; }
.map-frame .map-loading, .map-frame .map-error {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #fffaf5; color: #a0806a; font-size: 14px;
}
.map-frame .map-error { color: #dc2626; }
.map-plan-title { font-size: 15px; font-weight: 700; color: #6b3e26; }
.map-plan-input {
  flex: 1; min-height: 120px; padding: 10px;
  border: 1.5px solid #e8d5c4; border-radius: 10px;
  font-size: 13px; font-family: inherit; outline: none;
  resize: vertical; background: #fffaf5; box-sizing: border-box;
  transition: border-color .2s;
}
.map-plan-input:focus { border-color: #ff7b6a; }
.map-plan-save-status { font-size: 12px; color: #16a34a; min-height: 18px; }

.gallery-status {
  margin-top: 6px; font-size: 13px; text-align: center;
  color: #16a34a; min-height: 18px;
}

/* ===== lightbox ===== */
.lightbox-overlay {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(30, 15, 5, .72);
  align-items: center; justify-content: center;
  padding: 24px; box-sizing: border-box;
  cursor: zoom-out;
}
.lightbox-overlay.show { display: flex; }
.lightbox-overlay img {
  max-width: 90%; max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0,0,0,.4);
  cursor: default;
}

/* ===== mobile ===== */
@media (max-width: 900px) {
  body { display: block; min-height: auto; }
  .layout { padding-top: 54px; }
  .top-nav {
    padding: 0 12px; height: 54px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-left { font-size: 14px; flex-shrink: 0; }
  .nav-right { gap: 0; }
  .nav-link { padding: 6px 10px; font-size: 12px; }
  .birthday-title { font-size: 38px; margin-bottom: 18px; }
  .gift-wrap { transform: scale(.9); }
  .gift-wrap.opened { transform: scale(1); }

  .main-content { padding: 16px 12px 40px; }
  .section-container { padding: 16px; border-radius: 14px; }

  .hero-carousel-wrapper { border-radius: 12px; margin-bottom: 20px; }
  .hero-carousel { height: 380px; padding: 10px 0; }
  .carousel-arrow { width: 36px; height: 36px; font-size: 20px; }
  .carousel-arrow-left { left: 8px; }
  .carousel-arrow-right { right: 8px; }

  /* Mobile: 我们的瞬间 3x2 grid on left, 在一起时间 on right */
  .home-columns {
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
  }
  .moments-section {
    flex: 1.1;
    min-width: 0;
  }
  .moments-section .section-title {
    font-size: 14px;
    margin: 0 0 4px;
    padding-bottom: 4px;
  }
  .moments-section .section-title::after {
    width: 30px;
    height: 2px;
  }
  .moments-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }
  .moments-grid-item {
    border-radius: 6px;
    aspect-ratio: 4/3;
  }
  .counter-section {
    flex: 0.9;
    min-width: 0;
    padding: 20px 16px;
  }
  .counter-section .section-title {
    font-size: 18px;
    margin: 0 0 12px;
    padding-bottom: 8px;
  }
  .counter-section .section-title::after {
    width: 40px;
    height: 2px;
  }
  .counter-number { font-size: 40px; }
  .counter-unit { font-size: 18px; }
  .counter-start-date { font-size: 12px; margin-bottom: 10px; }
  .counter-decoration-img { max-width: 60px; }

  .gallery { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
  .gallery-item img { height: 72px; }

  /* Categories: grid layout 2 per row */
  #categoryList {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    overflow-x: visible;
  }
  #categoryGallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    overflow-x: visible;
  }
  .cat-card { min-width: 0; }

  .section-title { font-size: 20px; }
  .scroll-arrow { bottom: 10px; }

  .map-body { flex-direction: column; }
  .map-frame { height: 200px; }
  .map-plan-input { min-height: 80px; }
}

/* ===== extra small mobile ===== */
@media (max-width: 400px) {
  .top-nav {
    padding: 0 6px;
    height: 48px;
  }
  .layout { padding-top: 48px; }
  .nav-left { font-size: 12px; }
  .nav-link { padding: 4px 7px; font-size: 10px; }

  .home-columns { gap: 6px; }
  .moments-section { flex: 1.2; }
  .moments-section .section-title { font-size: 12px; }
  .moments-grid { gap: 3px; }
  .moments-grid-item { aspect-ratio: 4/3; }
  .counter-section { flex: 0.8; padding: 16px 10px; }
  .counter-section .section-title { font-size: 16px; }
  .counter-number { font-size: 34px; }
  .counter-unit { font-size: 16px; }
  .counter-start-date { font-size: 11px; }
  .counter-decoration-img { max-width: 50px; }
}
