:root {
  --bg: #f6f3ea;
  --surface: #fffdf6;
  --surface-2: #ece8db;
  --ink: #25312c;
  --muted: #6f776f;
  --line: #dfd8c8;
  --green: #547866;
  --green-dark: #365447;
  --gold: #c99542;
  --clay: #b96f58;
  --blue: #597e90;
  --shadow: 0 16px 45px rgba(59, 72, 64, 0.14);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #d8d6cc;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(216, 214, 204, 0.95), rgba(237, 233, 220, 0.9));
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  width: min(100vw, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow-x: hidden;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(62, 72, 64, 0.08), 0 24px 70px rgba(45, 53, 48, 0.22);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) 18px 12px;
  background: rgba(246, 243, 234, 0.92);
  border-bottom: 1px solid rgba(218, 211, 194, 0.82);
  backdrop-filter: blur(14px);
}

.topbar[hidden] {
  display: none;
}

.topbar h1,
.hero-brand h1,
.section-heading h2,
.store-intro h2,
.sheet-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 23px;
  line-height: 1.1;
  font-weight: 760;
}

.hero-brand {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: 18px;
  z-index: 2;
  color: #fffaf0;
  text-shadow: 0 2px 14px rgba(15, 25, 19, 0.28);
}

.hero-brand .eyebrow {
  color: rgba(255, 250, 240, 0.86);
}

.hero-brand h1 {
  font-size: 24px;
  line-height: 1.1;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.city-field,
.search-row label,
.field {
  display: grid;
  gap: 7px;
}

.city-field[hidden] {
  display: none;
}

.city-field span,
.search-row span,
.field span,
.switch-field span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.city-field select,
.field input,
.field select,
.search-row input,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 246, 0.94);
  color: var(--ink);
  outline: none;
}

.city-field select {
  min-width: 92px;
  padding: 8px 30px 8px 11px;
}

.city-field select[hidden] {
  display: none;
}

.field input,
.field select,
.search-row input,
.field textarea {
  padding: 11px 12px;
}

.field textarea {
  min-height: 104px;
  resize: vertical;
}

main {
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
}

.view {
  display: none;
  padding: 0 14px 20px;
}

.view.is-active {
  display: block;
}

.hero-media {
  position: relative;
  height: clamp(286px, 70vw, 342px);
  margin: 0 -14px 16px;
  overflow: hidden;
  background: #dfe5d9;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18, 31, 24, 0.03), rgba(21, 34, 29, 0.56));
}

.hero-copy {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 12px;
  color: #fffaf0;
}

.hero-copy p {
  grid-column: 1;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.hero-copy h2 {
  grid-column: 1;
  max-width: 240px;
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-copy .primary-action {
  grid-column: 2;
  grid-row: 1 / span 2;
  white-space: nowrap;
}

.primary-action,
.text-action,
.icon-button,
.bottom-nav button,
.light-button {
  border: 0;
  border-radius: var(--radius);
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  background: var(--green-dark);
  color: #fffaf0;
  font-weight: 760;
  box-shadow: 0 10px 24px rgba(47, 78, 64, 0.22);
}

.primary-action.full {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
}

.text-action {
  min-height: 36px;
  padding: 0 12px;
  background: rgba(84, 120, 102, 0.1);
  color: var(--green-dark);
  font-weight: 760;
}

.section-block {
  margin: 0 0 16px;
}

.section-block.compact {
  margin-top: 2px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h2,
.store-intro h2,
.sheet-head h2 {
  font-size: 21px;
  line-height: 1.2;
  font-weight: 780;
}

.my-memory-list {
  display: grid;
  gap: 10px;
}

.memory-card,
.store-card,
.empty-state {
  border: 1px solid rgba(217, 209, 190, 0.92);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(78, 75, 63, 0.08);
}

.memory-card {
  overflow: hidden;
}

.memory-card.my {
  display: grid;
  grid-template-columns: 98px 1fr;
  gap: 12px;
  min-height: 126px;
  padding: 10px;
}

.memory-thumb {
  position: relative;
  min-height: 106px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #ded9c8;
}

.image-open-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  text-align: inherit;
  cursor: zoom-in;
}

.memory-thumb img,
.memory-thumb video,
.feed-media img,
.feed-media video,
.store-card img,
.store-intro img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-mark {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 34px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(28, 39, 34, 0.72);
  color: #fffdf4;
  font-size: 11px;
  font-weight: 780;
}

.memory-main {
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-width: 0;
}

.memory-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.memory-title-row h3,
.feed-card h3,
.store-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: 0;
}

.privacy-pill,
.city-pill,
.service-pill,
.pet-fact-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.privacy-pill {
  padding: 0 8px;
  background: rgba(201, 149, 66, 0.14);
  color: #8c6429;
}

.privacy-pill.private {
  background: rgba(89, 126, 144, 0.13);
  color: var(--blue);
}

.memory-card p,
.feed-card p,
.store-card p,
.store-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.48;
}

.memory-meta,
.feed-meta,
.store-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.light-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px 0 8px;
  background: #f3ead8;
  color: #8a6126;
  font-size: 12px;
  font-weight: 780;
  overflow: visible;
}

.light-button.is-lit {
  background: rgba(201, 149, 66, 0.24);
  color: #7b521a;
  box-shadow: inset 0 0 0 1px rgba(201, 149, 66, 0.2), 0 8px 18px rgba(190, 129, 38, 0.13);
}

.candle-visual {
  position: relative;
  width: 16px;
  height: 24px;
  flex: 0 0 auto;
}

.candle-body {
  position: absolute;
  left: 4px;
  bottom: 0;
  width: 9px;
  height: 15px;
  border-radius: 5px 5px 3px 3px;
  background: linear-gradient(180deg, #fff9e8, #ead4a5);
  box-shadow: inset -2px 0 0 rgba(214, 186, 132, 0.34);
}

.candle-flame {
  position: absolute;
  left: 4px;
  top: 0;
  width: 9px;
  height: 13px;
  border-radius: 60% 60% 55% 55%;
  background: linear-gradient(180deg, #fff1a8 0%, #f4b24c 58%, #ce6f28 100%);
  transform-origin: 50% 100%;
  box-shadow: 0 0 0 5px rgba(222, 167, 66, 0.13), 0 0 18px rgba(226, 151, 45, 0.3);
}

.light-button.is-lit .candle-flame {
  animation: candle-flicker 760ms ease-in-out infinite alternate;
  box-shadow: 0 0 0 6px rgba(222, 167, 66, 0.18), 0 0 22px rgba(226, 151, 45, 0.48);
}

.countdown {
  min-width: 42px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 253, 246, 0.58);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

@keyframes candle-flicker {
  0% {
    transform: translateX(-0.5px) rotate(-4deg) scaleY(0.94);
  }

  45% {
    transform: translateX(0.5px) rotate(3deg) scaleY(1.08);
  }

  100% {
    transform: translateX(0) rotate(-1deg) scaleY(1);
  }
}

.spark {
  position: fixed;
  z-index: 80;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  pointer-events: none;
  background: #f2c65b;
  box-shadow: 0 0 18px rgba(232, 166, 56, 0.75);
  animation: spark 650ms ease-out forwards;
}

@keyframes spark {
  to {
    transform: translate(var(--dx), var(--dy)) scale(0.2);
    opacity: 0;
  }
}

.garden-feed {
  columns: 2 168px;
  column-gap: 10px;
}

.photo-wall {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 86px;
  gap: 9px;
  margin: -2px 0 12px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.photo-wall::-webkit-scrollbar {
  display: none;
}

.photo-tile {
  position: relative;
  height: 108px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(217, 209, 190, 0.92);
  border-radius: var(--radius);
  background: #e0dac9;
}

.photo-tile img,
.photo-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-tile::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 48px;
  background: linear-gradient(180deg, rgba(25, 34, 29, 0), rgba(25, 34, 29, 0.58));
}

.photo-tile span {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 7px;
  z-index: 1;
  overflow: hidden;
  color: #fffaf0;
  font-size: 12px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 10px;
  overflow: hidden;
  border: 1px solid rgba(217, 209, 190, 0.92);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(78, 75, 63, 0.08);
  break-inside: avoid;
}

.feed-media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #e0dac9;
}

.feed-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.feed-card h3 {
  font-size: 15px;
}

.feed-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.city-pill {
  padding: 0 8px;
  background: rgba(84, 120, 102, 0.12);
  color: var(--green-dark);
}

.pet-fact-pill {
  padding: 0 8px;
  background: rgba(89, 126, 144, 0.12);
  color: var(--blue);
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.store-intro {
  display: grid;
  grid-template-columns: 1.1fr 104px;
  align-items: center;
  gap: 12px;
  margin: 12px 0 14px;
  padding: 14px;
  border: 1px solid rgba(217, 209, 190, 0.9);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(78, 75, 63, 0.08);
}

.store-intro img {
  aspect-ratio: 1;
  border-radius: var(--radius);
}

.store-intro-side {
  display: grid;
  gap: 8px;
}

.store-intro-side img {
  width: 104px;
  height: 104px;
  object-fit: cover;
}

.store-intro-side .text-action {
  width: 104px;
  min-height: 34px;
  padding: 0 8px;
  font-size: 12px;
}

.search-row {
  margin-bottom: 12px;
}

.store-list {
  display: grid;
  gap: 12px;
}

.store-card {
  overflow: hidden;
}

.store-signboard {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  background: #ded8c8;
}

.store-signboard img {
  width: 100%;
  height: 132px;
  object-fit: cover;
  display: block;
}

.store-signboard::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(34, 45, 39, 0.04), rgba(34, 45, 39, 0.58));
}

.sign-overlay {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  display: grid;
  gap: 4px;
  color: #fffaf0;
}

.sign-overlay strong {
  font-size: 19px;
  line-height: 1.18;
  letter-spacing: 0;
  text-shadow: 0 2px 12px rgba(28, 36, 31, 0.38);
}

.store-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.store-title-row {
  display: grid;
  gap: 3px;
}

.store-meta {
  color: var(--muted);
  font-size: 12px;
}

.store-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.store-detail-grid span {
  display: grid;
  gap: 3px;
  min-height: 50px;
  padding: 8px;
  border-radius: var(--radius);
  background: rgba(246, 243, 234, 0.76);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.store-detail-grid b {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
}

.store-detail-grid em {
  font-style: normal;
}

.phone-detail {
  align-content: start;
}

.call-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 26px;
  margin-top: 2px;
  padding: 0 9px;
  border-radius: var(--radius);
  background: var(--green-dark);
  color: #fffaf0;
  text-decoration: none;
  font-size: 12px;
  font-weight: 760;
}

.service-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.service-pill {
  padding: 0 9px;
  background: rgba(185, 111, 88, 0.12);
  color: #864e3d;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: min(100vw, 430px);
  min-height: calc(66px + env(safe-area-inset-bottom));
  padding: 8px 26px calc(8px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid rgba(217, 209, 190, 0.92);
  background: rgba(255, 253, 246, 0.96);
  backdrop-filter: blur(16px);
}

.bottom-nav button {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 48px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.bottom-nav button.is-active {
  color: var(--green-dark);
  background: rgba(84, 120, 102, 0.09);
}

.nav-icon {
  position: relative;
  width: 23px;
  height: 23px;
  display: block;
}

.nav-icon-memory::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 2px;
  width: 9px;
  height: 16px;
  border-radius: 50% 50% 45% 45%;
  background: currentColor;
  box-shadow: 0 0 0 5px rgba(84, 120, 102, 0.12);
}

.nav-icon-store::before {
  content: "";
  position: absolute;
  inset: 8px 3px 3px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.nav-icon-store::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 3px;
  height: 8px;
  border-radius: 3px 3px 1px 1px;
  background: currentColor;
}

.composer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  justify-content: center;
  align-items: flex-end;
}

.composer.is-open {
  display: flex;
}

.composer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 28, 24, 0.42);
}

.composer-sheet {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 13px;
  width: min(100vw, 430px);
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 2px auto 6px;
  border-radius: 999px;
  background: #cfc7b6;
}

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

.icon-button {
  width: 38px;
  height: 38px;
  background: rgba(50, 60, 54, 0.08);
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
}

.switch-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.switch-field input {
  appearance: none;
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #c9c4b6;
  transition: 160ms ease;
}

.switch-field input::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(40, 43, 38, 0.2);
  transition: 160ms ease;
}

.switch-field input:checked {
  background: var(--green);
}

.switch-field input:checked::after {
  transform: translateX(18px);
}

.media-field input {
  padding: 10px;
  background: var(--surface);
}

.media-preview {
  display: grid;
  place-items: center;
  min-height: 118px;
  overflow: hidden;
  border: 1px dashed #c9bfa9;
  border-radius: var(--radius);
  background: rgba(255, 253, 246, 0.64);
  color: var(--muted);
  font-size: 13px;
}

.media-preview img,
.media-preview video {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 90;
  width: min(330px, calc(100vw - 40px));
  min-height: 42px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: rgba(37, 49, 44, 0.94);
  color: #fffaf0;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

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

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.gallery-modal.is-open {
  display: flex;
}

.gallery-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 25, 22, 0.78);
}

.gallery-viewer {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  display: grid;
  gap: 12px;
}

.gallery-close {
  justify-self: end;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(255, 253, 246, 0.16);
  color: #fffaf0;
  font-size: 25px;
  line-height: 1;
}

.gallery-frame {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #151c18;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.gallery-track {
  display: flex;
  transition: transform 240ms ease;
  will-change: transform;
}

.gallery-slide {
  flex: 0 0 100%;
  height: min(70vh, 620px);
  display: grid;
  place-items: center;
  background: #111713;
}

.gallery-slide img,
.gallery-slide video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 38px;
  height: 48px;
  transform: translateY(-50%);
  border: 0;
  border-radius: var(--radius);
  background: rgba(255, 253, 246, 0.2);
  color: #fffaf0;
  font-size: 34px;
  line-height: 1;
}

.gallery-nav:disabled {
  opacity: 0.35;
}

.gallery-nav.prev {
  left: 10px;
}

.gallery-nav.next {
  right: 10px;
}

.gallery-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  color: #fffaf0;
}

.gallery-caption strong {
  font-size: 15px;
  line-height: 1.3;
}

.gallery-caption span {
  font-size: 13px;
  color: rgba(255, 250, 240, 0.74);
}

@media (max-width: 360px) {
  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar h1 {
    font-size: 21px;
  }

  .hero-copy h2 {
    font-size: 24px;
  }

  .field-grid,
  .memory-card.my {
    grid-template-columns: 1fr;
  }

  .memory-thumb {
    aspect-ratio: 16 / 10;
  }

  .store-intro {
    grid-template-columns: 1fr;
  }

  .store-intro img {
    aspect-ratio: 16 / 9;
  }

  .store-intro-side img,
  .store-intro-side .text-action {
    width: 100%;
  }

  .store-detail-grid {
    grid-template-columns: 1fr;
  }
}
