:root {
  --paper: #f5efe5;
  --paper-deep: #ede5d8;
  --ink: #2f3733;
  --muted: #7c8077;
  --muted-light: #a4a498;
  --coral: #d97962;
  --coral-deep: #b75f4d;
  --coral-soft: #f1d7cd;
  --sage: #819178;
  --sage-soft: #dfe6d7;
  --line: rgba(64, 68, 61, 0.12);
  --white: #fffdf9;
  --shadow: 0 22px 70px rgba(88, 72, 53, 0.18);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(255, 255, 255, 0.8), transparent 28%),
    var(--paper);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
label:has(input:focus-visible) {
  outline: 3px solid rgba(217, 121, 98, 0.3);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: 100%;
  max-width: 780px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: calc(14px + var(--safe-top)) 14px calc(10px + var(--safe-bottom));
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 1px 5px 15px;
}

.brand h1,
.timeline-heading h2,
.form-heading h2,
.detail-content h2,
.info-sheet h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.brand h1 {
  margin-top: 3px;
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1.16;
}

.eyebrow {
  margin: 0;
  color: var(--coral-deep);
  font-family: "Avenir Next", "Futura", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.brand-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.round-button,
.close-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(70, 69, 62, 0.1);
  border-radius: 50%;
  background: rgba(255, 253, 249, 0.72);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.local-button {
  width: 40px;
  height: 40px;
  margin-top: 3px;
  color: var(--coral);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 3px;
}

.cloud-status-button {
  position: relative;
  width: 40px;
  height: 40px;
  color: #788a7c;
}

.cloud-status-button > i {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--white);
  border-radius: 50%;
  background: #bd8e7d;
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease;
}

.cloud-status-button.is-connected {
  color: #587765;
}

.cloud-status-button.is-connected > i {
  background: #66a078;
  box-shadow: 0 0 0 3px rgba(102, 160, 120, 0.13);
}

.cloud-status-button.is-syncing > i {
  background: #d1a459;
  animation: sync-pulse 1s ease-in-out infinite alternate;
}

.round-button svg,
.close-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.map-view {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.map-view[hidden],
.timeline-view[hidden] {
  display: none;
}

.map-view.is-active {
  animation: view-in 0.42s ease both;
}

.map-meta {
  padding: 0 4px 11px;
}

.stats {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.stats strong {
  color: var(--ink);
  font-family: "Avenir Next", sans-serif;
  font-size: 14px;
  font-weight: 650;
}

.stats i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--muted-light);
}

.filter-row {
  display: flex;
  gap: 7px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 253, 249, 0.54);
  font-size: 11px;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.filter-chip:active {
  transform: scale(0.96);
}

.filter-chip.is-active {
  border-color: var(--ink);
  color: var(--white);
  background: var(--ink);
}

.map-frame {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(86, 80, 68, 0.12);
  border-radius: 28px;
  background: var(--paper-deep);
  box-shadow:
    0 18px 42px rgba(101, 82, 58, 0.1),
    inset 0 0 0 4px rgba(255, 255, 255, 0.28);
}

.map-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  background: #e9e3d8;
  font-family: "PingFang SC", "Hiragino Sans GB", sans-serif;
}

.map-canvas.is-placing {
  cursor: crosshair;
}

.leaflet-tile-pane {
  filter: saturate(0.72) sepia(0.08) brightness(1.03);
}

.map-canvas.is-placing::after {
  position: absolute;
  inset: 0;
  z-index: 1050;
  border: 2px solid rgba(217, 121, 98, 0.48);
  border-radius: inherit;
  content: "";
  pointer-events: none;
  animation: placement-pulse 1.6s ease-in-out infinite;
}

.map-loading {
  position: absolute;
  inset: 0;
  z-index: 900;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 253, 247, 0.95), rgba(241, 234, 222, 0.94) 55%),
    var(--paper-deep);
  font-size: 10px;
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease;
}

.map-loading.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.map-loading span {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(217, 121, 98, 0.18);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: map-spin 0.9s linear infinite;
}

.map-loading p {
  margin: 0;
}

.city-badge {
  position: absolute;
  left: 13px;
  top: 13px;
  z-index: 1002;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px 8px 11px;
  border: 1px solid rgba(84, 76, 64, 0.11);
  border-radius: 999px;
  color: #4e554f;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 8px 24px rgba(78, 67, 50, 0.13);
  font-size: 10px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(10px);
}

.city-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(217, 121, 98, 0.14);
}

.city-badge button {
  padding: 4px 7px;
  border: 0;
  border-radius: 999px;
  color: var(--coral-deep);
  background: var(--coral-soft);
  font-size: 9px;
  cursor: pointer;
}

.locate-button {
  position: absolute;
  right: 13px;
  top: 13px;
  z-index: 1002;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(84, 76, 64, 0.11);
  border-radius: 50%;
  color: var(--coral-deep);
  background: rgba(255, 253, 248, 0.93);
  box-shadow: 0 8px 24px rgba(78, 67, 50, 0.13);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.locate-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.locate-button.is-locating svg {
  animation: locate-pulse 0.9s ease-in-out infinite alternate;
}

.leaflet-control-zoom {
  margin-right: 13px !important;
  margin-bottom: 43px !important;
  overflow: hidden;
  border: 1px solid rgba(84, 76, 64, 0.11) !important;
  border-radius: 13px !important;
  box-shadow: 0 8px 24px rgba(78, 67, 50, 0.12) !important;
}

.leaflet-control-zoom a {
  width: 32px !important;
  height: 31px !important;
  border-color: rgba(84, 76, 64, 0.08) !important;
  color: #615f57 !important;
  background: rgba(255, 253, 248, 0.93) !important;
  font-family: "Avenir Next", sans-serif !important;
  font-size: 18px !important;
  line-height: 29px !important;
}

.leaflet-control-zoom a:hover {
  color: var(--coral-deep) !important;
  background: #fffaf4 !important;
}

.leaflet-memory-marker {
  border: 0;
  background: transparent;
}

.memory-route {
  animation: route-dash 1.6s linear infinite;
}

.memory-marker-inner {
  position: relative;
  width: 42px;
  height: 53px;
}

.memory-marker-inner::before {
  position: absolute;
  left: 50%;
  top: 1px;
  width: 39px;
  height: 39px;
  border: 1px solid rgba(217, 121, 98, 0.22);
  border-radius: 50%;
  background: rgba(245, 216, 204, 0.2);
  content: "";
  transform: translateX(-50%);
  animation: pin-halo-breathe 2.8s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.marker-bubble {
  position: absolute;
  left: 50%;
  top: 7px;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 2px solid var(--white);
  border-radius: 50% 50% 50% 10%;
  color: var(--white);
  background: var(--coral);
  box-shadow: 0 5px 14px rgba(111, 65, 49, 0.25);
  transform: translateX(-50%) rotate(-45deg);
  transition:
    transform 0.22s ease,
    background 0.22s ease;
}

.leaflet-memory-marker.is-daily .marker-bubble {
  background: #7d9789;
}

.leaflet-memory-marker.is-first .marker-bubble {
  background: #bc8568;
}

.marker-bubble span {
  font-family: "Songti SC", serif;
  font-size: 9px;
  font-weight: 600;
  transform: rotate(45deg);
}

.leaflet-memory-marker:hover .marker-bubble,
.leaflet-memory-marker:focus-within .marker-bubble {
  transform: translateX(-50%) rotate(-45deg) scale(1.12);
}

.marker-label {
  position: absolute;
  left: 50%;
  top: 40px;
  max-width: 120px;
  padding: 3px 7px;
  overflow: hidden;
  border: 1px solid rgba(82, 76, 64, 0.1);
  border-radius: 999px;
  color: #5d6058;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 4px 10px rgba(88, 76, 58, 0.08);
  font-size: 9px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateX(-50%);
  backdrop-filter: blur(5px);
}

.leaflet-memory-marker.is-new .memory-marker-inner {
  animation: new-pin-in 0.65s cubic-bezier(0.2, 1.6, 0.35, 1) both;
}

.user-location-dot {
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #397e9d;
  box-shadow:
    0 3px 9px rgba(31, 77, 94, 0.28),
    0 0 0 6px rgba(57, 126, 157, 0.16);
}

.map-empty {
  position: absolute;
  left: 50%;
  top: 48%;
  z-index: 1001;
  width: min(250px, 76%);
  padding: 22px;
  border: 1px solid rgba(99, 87, 70, 0.1);
  border-radius: 24px;
  background: rgba(255, 252, 246, 0.88);
  box-shadow: 0 20px 50px rgba(92, 76, 53, 0.13);
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(8px);
}

.empty-heart {
  display: block;
  margin-bottom: 5px;
  color: var(--coral);
  font-family: "Songti SC", serif;
  font-size: 34px;
  line-height: 1;
}

.map-empty strong {
  font-family: "Songti SC", serif;
  font-size: 18px;
}

.map-empty p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.placement-hint {
  position: absolute;
  left: 50%;
  top: 62px;
  z-index: 1003;
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 26px);
  padding: 9px 10px 9px 13px;
  border: 1px solid rgba(74, 70, 61, 0.1);
  border-radius: 999px;
  color: #514f48;
  background: rgba(255, 253, 249, 0.94);
  box-shadow: 0 12px 30px rgba(87, 67, 47, 0.16);
  font-size: 11px;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
  animation: hint-in 0.3s ease both;
}

.placement-hint button {
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  color: var(--coral-deep);
  background: var(--coral-soft);
  font-size: 10px;
  cursor: pointer;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 0 rgba(217, 121, 98, 0.4);
  animation: dot-pulse 1.7s ease-out infinite;
}

.map-legend {
  position: absolute;
  right: 13px;
  bottom: 12px;
  left: 13px;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid rgba(94, 83, 68, 0.08);
  border-radius: 999px;
  color: #77756a;
  background: rgba(255, 253, 248, 0.74);
  font-size: 8px;
  backdrop-filter: blur(5px);
}

.map-legend span i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--coral);
}

.map-legend > a {
  padding: 4px 8px;
  border-radius: 999px;
  color: #77756a;
  background: rgba(255, 253, 248, 0.68);
  font-size: 7px;
  text-decoration: none;
  pointer-events: auto;
  backdrop-filter: blur(5px);
}

.bottom-dock {
  position: relative;
  z-index: 10;
  align-self: end;
  display: grid;
  grid-template-columns: 1fr 1fr 68px 1fr 1fr;
  align-items: center;
  width: min(100%, 470px);
  height: 66px;
  margin: 10px auto 0;
  padding: 6px 13px;
  border: 1px solid rgba(75, 71, 62, 0.1);
  border-radius: 24px;
  background: rgba(255, 253, 249, 0.9);
  box-shadow: 0 15px 35px rgba(72, 61, 47, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  height: 52px;
  padding: 0;
  border: 0;
  color: #9b9a90;
  background: transparent;
  font-size: 9px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.nav-item.is-active {
  color: var(--ink);
}

.add-button {
  z-index: 2;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: -22px auto 0;
  border: 3px solid var(--paper);
  border-radius: 50%;
  color: white;
  background: var(--coral);
  box-shadow: 0 10px 23px rgba(183, 95, 77, 0.34);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.add-button:active {
  transform: scale(0.92) rotate(4deg);
}

.add-button svg {
  width: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.timeline-view {
  min-height: 0;
  overflow-y: auto;
  padding: 5px 4px 18px;
  scrollbar-width: none;
  animation: view-in 0.42s ease both;
}

.timeline-view::-webkit-scrollbar {
  display: none;
}

.timeline-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 5px 2px 17px;
}

.timeline-heading h2 {
  margin-top: 4px;
  font-size: 25px;
}

.timeline-total {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
}

.timeline-list {
  position: relative;
}

.timeline-list::before {
  position: absolute;
  top: 22px;
  bottom: 12px;
  left: 23px;
  width: 1px;
  background: linear-gradient(to bottom, rgba(217, 121, 98, 0.3), rgba(129, 145, 120, 0.08));
  content: "";
}

.year-divider {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 10px 4px;
  color: var(--muted);
  font-family: "Avenir Next", sans-serif;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.year-divider::before {
  z-index: 1;
  width: 7px;
  height: 7px;
  margin-left: 16px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 1px rgba(217, 121, 98, 0.22);
  content: "";
}

.timeline-card {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 13px;
  width: calc(100% - 26px);
  margin: 0 0 12px 26px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid rgba(82, 77, 67, 0.09);
  border-radius: 19px;
  color: inherit;
  background: rgba(255, 253, 249, 0.77);
  box-shadow: 0 8px 24px rgba(89, 73, 53, 0.06);
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.timeline-card:active {
  transform: scale(0.985);
}

.timeline-card::before {
  position: absolute;
  left: -33px;
  top: 27px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(217, 121, 98, 0.22);
  content: "";
}

.timeline-thumb,
.detail-cover,
.photo-preview {
  position: relative;
  overflow: hidden;
  background: #d9cebd;
}

.timeline-thumb {
  height: 96px;
  border-radius: 13px;
}

.timeline-thumb img,
.detail-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.timeline-info {
  min-width: 0;
  padding: 5px 5px 4px 0;
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-light);
  font-family: "Avenir Next", sans-serif;
  font-size: 9px;
}

.timeline-meta .category-badge {
  font-family: "PingFang SC", sans-serif;
}

.timeline-card h3 {
  margin: 6px 0 4px;
  overflow: hidden;
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-place {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-place svg {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.timeline-excerpt {
  display: -webkit-box;
  margin: 7px 0 0;
  overflow: hidden;
  color: #97958b;
  font-size: 9px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  color: #886852;
  background: #eee1d2;
  font-size: 9px;
}

.category-badge.category-初见 {
  color: #8c624f;
  background: #f0ddd2;
}

.category-badge.category-旅行 {
  color: #637766;
  background: #dfe8dc;
}

.category-badge.category-日常 {
  color: #77705c;
  background: #eae5d5;
}

.timeline-empty {
  margin-top: 8vh;
  text-align: center;
}

.timeline-empty > span {
  color: var(--coral);
  font-size: 34px;
}

.timeline-empty h3 {
  margin: 5px 0;
  font-family: "Songti SC", serif;
  font-size: 21px;
}

.timeline-empty p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.art-cover {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.art-cover::before,
.art-cover::after {
  position: absolute;
  content: "";
}

.art-sun {
  position: absolute;
  top: 18%;
  right: 17%;
  width: 24%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 244, 207, 0.88);
  box-shadow: 0 0 28px rgba(255, 237, 189, 0.58);
}

.art-hill {
  position: absolute;
  right: -12%;
  bottom: -34%;
  left: -18%;
  height: 78%;
  border-radius: 50% 50% 0 0;
  background: rgba(66, 89, 74, 0.42);
  transform: rotate(-7deg);
}

.art-hill.hill-two {
  right: -20%;
  bottom: -45%;
  left: 22%;
  height: 86%;
  background: rgba(42, 65, 57, 0.46);
  transform: rotate(9deg);
}

.art-stars {
  position: absolute;
  inset: 0;
  opacity: 0.75;
  background-image:
    radial-gradient(circle at 18% 20%, #fff9da 0 1px, transparent 1.8px),
    radial-gradient(circle at 68% 14%, #fff9da 0 1px, transparent 1.8px),
    radial-gradient(circle at 44% 42%, #fff9da 0 1px, transparent 1.8px),
    radial-gradient(circle at 82% 51%, #fff9da 0 1.2px, transparent 2px),
    radial-gradient(circle at 27% 58%, #fff9da 0 1px, transparent 1.8px);
}

.art-rain {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background: repeating-linear-gradient(105deg, transparent 0 9px, rgba(255, 255, 255, 0.8) 10px 11px);
}

.art-window {
  position: absolute;
  right: 12%;
  bottom: 13%;
  width: 27%;
  height: 38%;
  border: 2px solid rgba(255, 250, 232, 0.55);
  border-radius: 45% 45% 4px 4px;
  background: rgba(255, 240, 190, 0.22);
  box-shadow: 0 0 28px rgba(255, 232, 173, 0.25);
}

.cover-sunset {
  background: linear-gradient(155deg, #c78d7c, #dba17d 48%, #8b7c7b);
}

.cover-sea {
  background: linear-gradient(155deg, #7e9d9d, #b4c6ba 54%, #d6c0a8);
}

.cover-city {
  background: linear-gradient(155deg, #5f6668, #8d7469 55%, #c19377);
}

.cover-night {
  background: linear-gradient(145deg, #4d5c62, #82706e 58%, #c38e75);
}

.cover-daily {
  background: linear-gradient(145deg, #9f9e83, #c6b898 55%, #d2a88f);
}

.cover-garden {
  background: linear-gradient(145deg, #748a75, #aebc9f 55%, #d3c5a5);
}

.cover-kicker {
  position: absolute;
  left: 10px;
  bottom: 9px;
  z-index: 2;
  color: rgba(255, 253, 245, 0.82);
  font-family: "Avenir Next", sans-serif;
  font-size: 7px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 10px calc(10px + var(--safe-bottom));
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: rgba(41, 43, 38, 0.34);
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in 0.25s ease both;
}

.detail-sheet,
.form-sheet,
.info-sheet,
.cloud-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 570px);
  max-height: min(90dvh, 820px);
  overflow-y: auto;
  border: 1px solid rgba(75, 68, 58, 0.1);
  border-radius: 30px;
  background: var(--white);
  box-shadow: var(--shadow);
  scrollbar-width: none;
  animation: sheet-up 0.34s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.detail-sheet::-webkit-scrollbar,
.form-sheet::-webkit-scrollbar,
.info-sheet::-webkit-scrollbar,
.cloud-sheet::-webkit-scrollbar {
  display: none;
}

.sheet-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 3;
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  transform: translateX(-50%);
}

.close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 34px;
  height: 34px;
  color: var(--ink);
}

.detail-cover {
  height: min(32dvh, 280px);
  border-radius: 28px 28px 0 0;
}

.detail-cover .cover-kicker {
  left: 22px;
  bottom: 18px;
  font-size: 9px;
}

.detail-content {
  padding: 22px 23px 18px;
}

.detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-light);
  font-family: "Avenir Next", sans-serif;
  font-size: 10px;
}

.detail-content h2 {
  margin-top: 12px;
  font-size: 27px;
  line-height: 1.25;
}

.detail-place {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 9px 0 18px;
  color: var(--coral-deep);
  font-size: 11px;
}

.detail-place svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.detail-story {
  margin: 0;
  color: #61635d;
  font-family: "Songti SC", "STSong", serif;
  font-size: 15px;
  line-height: 1.9;
  white-space: pre-wrap;
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.soft-button,
.primary-button,
.text-danger-button,
.import-label {
  border: 0;
  cursor: pointer;
}

.soft-button {
  padding: 10px 15px;
  border: 1px solid rgba(83, 78, 67, 0.1);
  border-radius: 12px;
  color: #5f625a;
  background: #f4efe6;
  font-size: 11px;
}

.text-danger-button {
  padding: 6px 0;
  color: #aa7266;
  background: transparent;
  font-size: 10px;
}

.form-sheet {
  padding: 22px 20px 22px;
}

.form-heading {
  display: flex;
  justify-content: space-between;
  padding: 4px 2px 16px;
}

.form-heading h2 {
  margin-top: 4px;
  font-size: 24px;
}

.close-button-inline {
  position: static;
  color: var(--muted);
  background: #f5f0e7;
}

.photo-picker {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 132px;
  overflow: hidden;
  border: 1px dashed rgba(141, 115, 94, 0.35);
  border-radius: 18px;
  color: #8e8174;
  background:
    radial-gradient(circle at 75% 25%, rgba(255, 255, 255, 0.9), transparent 33%),
    #f5eee3;
  cursor: pointer;
}

.photo-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.photo-picker-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.camera-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 6px;
  border-radius: 50%;
  color: var(--coral-deep);
  background: var(--coral-soft);
}

.camera-mark svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.photo-picker-empty strong {
  font-size: 12px;
  font-weight: 500;
}

.photo-picker-empty small {
  margin-top: 4px;
  color: #aaa094;
  font-size: 9px;
}

.photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-photo {
  position: absolute;
  right: 9px;
  top: 9px;
  z-index: 2;
  padding: 5px 9px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: rgba(42, 43, 40, 0.54);
  font-size: 9px;
  cursor: pointer;
  backdrop-filter: blur(5px);
}

.field-group {
  position: relative;
  margin-top: 15px;
}

.field-group > label,
.field-group legend {
  display: block;
  margin: 0 0 6px;
  color: #706f67;
  font-size: 10px;
}

.field-group input:not([type="file"]):not([type="radio"]),
.field-group textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(86, 78, 66, 0.12);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #f8f4ed;
  font-size: 12px;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.field-group input:focus,
.field-group textarea:focus {
  border-color: rgba(217, 121, 98, 0.46);
  background: #fffaf4;
}

.field-group input::placeholder,
.field-group textarea::placeholder {
  color: #b5aca0;
}

.field-group textarea {
  min-height: 100px;
  padding-bottom: 24px;
  line-height: 1.7;
  resize: vertical;
}

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

.category-field {
  padding: 0;
  border: 0;
}

.category-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.category-options label {
  cursor: pointer;
}

.category-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-options span {
  display: block;
  padding: 8px 6px;
  border: 1px solid rgba(86, 78, 66, 0.11);
  border-radius: 11px;
  color: var(--muted);
  background: #f8f4ed;
  font-size: 10px;
  text-align: center;
}

.category-options input:checked + span {
  border-color: rgba(183, 95, 77, 0.25);
  color: var(--coral-deep);
  background: var(--coral-soft);
}

.character-count {
  position: absolute;
  right: 10px;
  bottom: 7px;
  color: #b1a99e;
  font-family: "Avenir Next", sans-serif;
  font-size: 8px;
}

.location-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 12px 2px -2px;
  color: #8b8174;
  font-size: 9px;
  line-height: 1.5;
}

.location-note svg {
  width: 13px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--coral);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 18px;
  border-radius: 14px;
  color: white;
  background: var(--ink);
  font-size: 12px;
  cursor: pointer;
}

.primary-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.submit-button {
  width: 100%;
  margin-top: 18px;
  background: var(--coral);
  box-shadow: 0 10px 20px rgba(183, 95, 77, 0.18);
}

.info-sheet {
  padding: 33px 24px 24px;
  text-align: center;
}

.info-sheet .close-button {
  color: var(--muted);
  background: #f6f1e9;
}

.info-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 17px;
  border: 1px solid rgba(217, 121, 98, 0.16);
  border-radius: 50%;
  color: var(--coral);
  background: #fbf1e9;
  font-family: "Songti SC", serif;
  font-size: 30px;
}

.info-sheet h2 {
  margin-top: 5px;
  font-size: 24px;
}

.cloud-sheet {
  padding: 32px 24px 22px;
  text-align: center;
}

.cloud-sheet .close-button {
  color: var(--muted);
  background: #f5f0e7;
}

.cloud-emblem {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border: 1px solid rgba(102, 132, 112, 0.16);
  border-radius: 22px;
  color: #5e806a;
  background:
    radial-gradient(circle at 70% 24%, rgba(255, 255, 255, 0.8), transparent 35%),
    #e8eee6;
  transform: rotate(-3deg);
}

.cloud-emblem svg {
  width: 30px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.cloud-sheet h2 {
  margin: 5px 0 0;
  color: var(--ink);
  font-family: "Songti SC", "STSong", serif;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.cloud-view {
  margin-top: 17px;
}

.cloud-copy {
  max-width: 390px;
  margin: 0 auto 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.cloud-form {
  margin-top: 14px;
  text-align: left;
}

.cloud-form > label {
  display: block;
  margin: 0 0 6px;
  color: #77756c;
  font-size: 10px;
}

.cloud-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.cloud-input-row input {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(84, 78, 67, 0.13);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #f8f4ed;
  font-size: 12px;
}

.cloud-input-row input:focus {
  border-color: rgba(107, 135, 115, 0.45);
  background: #fffaf4;
}

.cloud-primary,
.cloud-secondary {
  padding: 11px 15px;
  border: 0;
  border-radius: 12px;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.cloud-primary {
  color: white;
  background: #5e806a;
  box-shadow: 0 8px 18px rgba(74, 105, 83, 0.2);
}

.cloud-secondary {
  color: #5b6f5e;
  background: #e5ece3;
}

.cloud-primary:active,
.cloud-secondary:active {
  transform: scale(0.97);
}

.cloud-primary:disabled,
.cloud-secondary:disabled {
  opacity: 0.52;
  cursor: wait;
}

.cloud-wide-button {
  width: 100%;
}

.cloud-message {
  min-height: 16px;
  margin: 10px 0 0;
  color: var(--coral-deep);
  font-size: 10px;
  line-height: 1.55;
}

.cloud-message.is-success {
  color: #5e806a;
}

.cloud-skip,
.cloud-signout {
  padding: 6px 0;
  border: 0;
  color: #99958b;
  background: transparent;
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.cloud-skip {
  margin-top: 9px;
}

.cloud-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 5px;
  color: #aaa69c;
  font-size: 9px;
}

.cloud-separator::before,
.cloud-separator::after {
  flex: 1;
  height: 1px;
  background: var(--line);
  content: "";
}

.cloud-connected-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #4f735b;
  background: #e8efe7;
  font-size: 10px;
}

.cloud-connected-mark span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #66a078;
  box-shadow: 0 0 0 3px rgba(102, 160, 120, 0.13);
}

.invite-code-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 18px;
  border: 1px dashed rgba(94, 128, 106, 0.36);
  border-radius: 17px;
  color: #52725e;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.8), transparent 32%),
    #f0f4ed;
  cursor: pointer;
}

.invite-code-card span {
  font-size: 9px;
  letter-spacing: 0.08em;
}

.invite-code-card strong {
  margin: 4px 0 2px;
  font-family: "Avenir Next", monospace;
  font-size: 26px;
  letter-spacing: 0.16em;
}

.invite-code-card small {
  color: #7e9383;
  font-size: 8px;
}

.cloud-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: #929087;
  font-size: 9px;
}

.cloud-upload-local {
  width: 100%;
  margin-top: 11px;
  padding: 10px 12px;
  border: 1px solid rgba(94, 128, 106, 0.16);
  border-radius: 12px;
  color: #5b7663;
  background: #f1f5ef;
  font-size: 10px;
  cursor: pointer;
}

.cloud-account-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-copy {
  max-width: 370px;
  margin: 12px auto 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.info-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.info-actions .soft-button,
.import-label {
  display: grid;
  place-items: center;
  min-height: 42px;
  font-size: 11px;
}

.import-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.reset-button {
  margin-top: 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(90px + var(--safe-bottom));
  z-index: 80;
  max-width: calc(100% - 32px);
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: white;
  background: rgba(45, 50, 46, 0.92);
  box-shadow: 0 10px 30px rgba(44, 42, 35, 0.2);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

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

@keyframes pin-halo-breathe {
  0%,
  100% {
    transform: translateX(-50%) scale(0.88);
    opacity: 0.62;
  }
  50% {
    transform: translateX(-50%) scale(1.15);
    opacity: 0.2;
  }
}

@keyframes map-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes sync-pulse {
  to {
    box-shadow: 0 0 0 5px rgba(209, 164, 89, 0.15);
  }
}

@keyframes route-dash {
  to {
    stroke-dashoffset: -28;
  }
}

@keyframes locate-pulse {
  to {
    color: #397e9d;
    transform: scale(1.12);
  }
}

@keyframes dot-pulse {
  70% {
    box-shadow: 0 0 0 7px rgba(217, 121, 98, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(217, 121, 98, 0);
  }
}

@keyframes placement-pulse {
  50% {
    border-color: rgba(217, 121, 98, 0.18);
  }
}

@keyframes new-pin-in {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hint-in {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes sheet-up {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 620px) {
  .app-shell {
    padding-right: 24px;
    padding-left: 24px;
  }

  .map-frame {
    border-radius: 34px;
  }

  .timeline-card {
    grid-template-columns: 116px minmax(0, 1fr);
  }

  .timeline-thumb {
    height: 110px;
  }

  .timeline-card h3 {
    font-size: 18px;
  }
}

@media (min-width: 900px) {
  .app-shell {
    max-width: 860px;
  }

  .memories-layout {
    display: grid;
  }
}

@media (max-height: 690px) {
  .brand-note {
    display: none;
  }

  .topbar {
    padding-bottom: 8px;
  }

  .bottom-dock {
    margin-top: 7px;
  }

  .map-meta {
    padding-bottom: 7px;
  }

  .filter-row {
    margin-top: 6px;
  }
}

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