/* 馨宝与树宝 · 方案 C：晚风粉霞（浅暮色 · 不闷） */

:root {
  --bg: #faf4f6;
  --ink: #3d2f38;
  --muted: #8f7584;
  --rose: #d97b92;
  --rose-deep: #c45f7a;
  --gold: #c4a574;
  --line: rgba(217, 123, 146, 0.28);
  --panel: rgba(255, 252, 253, 0.9);
  --card: #fffcfd;
  --font-display: "Songti SC", "STSong", "PingFang SC", Georgia, serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.75;
  background:
    radial-gradient(ellipse 85% 50% at 50% -8%, rgba(232, 180, 198, 0.42), transparent 58%),
    radial-gradient(ellipse 50% 35% at 95% 85%, rgba(220, 200, 170, 0.22), transparent 55%),
    linear-gradient(180deg, #f7eef2 0%, var(--bg) 42%, #f3ebe4 100%);
}

/* ----- 暗号门 ----- */
body.is-locked .view,
body.is-locked .lightbox {
  display: none !important;
}

.gate {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

body.is-locked .gate {
  display: flex;
  animation: fade-in 0.4s ease both;
}

.gate-card {
  width: min(380px, 100%);
  text-align: center;
  padding: 2.2rem 1.6rem 1.8rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(61, 47, 56, 0.08);
}

.gate-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--gold);
  margin-bottom: 0.65rem;
}

.gate-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink);
}

.gate-hint {
  margin-top: 0.55rem;
  margin-bottom: 1.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-align: left;
}

.gate-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.gate-input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
}

.gate-input:focus {
  outline: 2px solid rgba(217, 123, 146, 0.35);
  border-color: var(--rose);
}

.gate-error {
  font-size: 0.82rem;
  color: var(--rose-deep);
}

.gate-btn {
  margin-top: 0.35rem;
  width: 100%;
}

.view { display: none; }
.view[hidden] { display: none !important; }
.view.is-active:not([hidden]) {
  display: block;
  animation: fade-in 0.35s ease both;
}

.view-home {
  width: min(900px, 94%);
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
  min-height: 100vh;
  display: none;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

.view-home.is-active:not([hidden]) {
  display: flex;
}

.view-page {
  width: min(720px, 92%);
  margin: 0 auto;
  padding: 1.25rem 0 5rem;
  min-height: 100vh;
  box-sizing: border-box;
}

.home-hero {
  text-align: center;
  margin-bottom: 1.5rem;
  animation: rise 0.8s ease both;
}

.hero-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 0.7rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.hero-sub {
  margin-top: 0.6rem;
  color: var(--muted);
}

.hero-days {
  margin-top: 0.9rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--rose-deep);
  letter-spacing: 0.06em;
  animation: pulse-soft 3.2s ease-in-out infinite;
}

.privacy-note {
  margin-top: 0.7rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.home-reminders {
  width: 100%;
  margin: 0 0 1.35rem;
  padding: 0.95rem 1rem 0.85rem;
  background: rgba(255, 252, 253, 0.72);
  border: 1px solid rgba(217, 123, 146, 0.22);
  border-radius: 16px;
  animation: rise 0.8s ease 0.05s both;
}

.reminders-head {
  text-align: center;
  margin-bottom: 0.7rem;
}

.reminders-kicker {
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  color: var(--gold);
}

.reminders-title {
  margin-top: 0.2rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--rose-deep);
}

.reminder-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.reminder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(217, 123, 146, 0.12);
}

.reminder-item.is-soon {
  border-color: rgba(217, 123, 146, 0.35);
  background: rgba(248, 238, 242, 0.9);
}

.reminder-item.is-today {
  border-color: rgba(196, 95, 122, 0.45);
  background: linear-gradient(165deg, rgba(255, 245, 248, 0.95), rgba(248, 230, 236, 0.95));
}

.reminder-name {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
}

.reminder-date {
  margin-top: 0.1rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.reminder-countdown {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--rose-deep);
  white-space: nowrap;
}

.reminder-item.is-today .reminder-countdown {
  font-weight: 600;
}

.reminder-empty {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.35rem 0.2rem 0.15rem;
  line-height: 1.55;
}

.date-range-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.date-range-row label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.date-range-row input {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(217, 123, 146, 0.28);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.date-range-row input:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(217, 123, 146, 0.14);
}

@media (max-width: 520px) {
  .date-range-row {
    grid-template-columns: 1fr;
  }
}

.check-row {
  flex-direction: row !important;
  align-items: center;
  gap: 0.55rem !important;
  font-size: 0.88rem !important;
  color: var(--ink) !important;
  cursor: pointer;
}

.check-row input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--rose-deep);
}

#event-date-end:disabled {
  opacity: 0.45;
  background: #f3ebe4;
}

.btn-mini--accent {
  color: var(--rose-deep);
  border-color: rgba(217, 123, 146, 0.45);
  background: rgba(217, 123, 146, 0.08);
}

.btn-mini--accent:hover {
  color: #fff;
  background: var(--rose-deep);
  border-color: var(--rose-deep);
}

.btn-mini--active {
  color: var(--muted);
  border-style: dashed;
}

.entry-item.is-remind {
  border-color: rgba(196, 95, 122, 0.28);
}

.remind-badge {
  display: inline-block;
  margin-right: 0.35rem;
  font-size: 0.68rem;
  color: #fff;
  background: var(--rose-deep);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  vertical-align: middle;
}

.entry-remind {
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: var(--rose-deep);
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
  align-items: stretch;
  animation: rise 0.8s ease 0.1s both;
}

.tile-grid .tile:nth-child(5) {
  grid-column: auto;
  width: auto;
  justify-self: stretch;
}

.tile {
  aspect-ratio: 1 / 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(165deg, #ffffff 0%, #f8eef2 100%);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(196, 95, 122, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tile:hover,
.tile:focus-visible {
  transform: translateY(-3px) scale(1.03);
  border-color: var(--rose);
  box-shadow: 0 12px 24px rgba(196, 95, 122, 0.14);
  outline: none;
}

.tile-num {
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.tile-name {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 1.8vw, 1.1rem);
  letter-spacing: 0.06em;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  padding: 0 0.2rem;
}

@media (max-width: 640px) {
  .tile-name {
    font-size: 0.92rem;
    letter-spacing: 0.03em;
  }
}

.page-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.35rem;
}

.btn-back {
  font: inherit;
  font-size: 0.9rem;
  color: var(--rose-deep);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-back:hover {
  background: #f8eef2;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  letter-spacing: 0.12em;
  color: var(--rose-deep);
  font-weight: 600;
}

.page-desc {
  color: var(--muted);
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
}

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.filter-search {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 252, 253, 0.9);
  border: 1px solid rgba(217, 123, 146, 0.28);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
}

.filter-search:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(217, 123, 146, 0.14);
}

.filter-search::placeholder {
  color: rgba(143, 117, 132, 0.75);
}

.author-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.author-chip {
  font: inherit;
  font-size: 0.72rem;
  line-height: 1;
  color: var(--muted);
  background: rgba(255, 252, 253, 0.85);
  border: 1px solid rgba(217, 123, 146, 0.22);
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.author-chip:hover {
  color: var(--rose-deep);
  border-color: rgba(217, 123, 146, 0.45);
}

.author-chip.is-active {
  color: #fff;
  background: linear-gradient(165deg, #d97b92 0%, #c45f7a 100%);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(196, 95, 122, 0.22);
}

.entry-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
  padding: 1.1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 1.2rem;
  box-shadow: 0 8px 22px rgba(196, 95, 122, 0.06);
}

.entry-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.entry-form label.full { grid-column: 1 / -1; }

.entry-form input,
.entry-form textarea,
.entry-form select {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(217, 123, 146, 0.28);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.entry-form input:focus,
.entry-form textarea:focus,
.entry-form select:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(217, 123, 146, 0.14);
}

.btn {
  grid-column: 1 / -1;
  justify-self: start;
  font: inherit;
  font-weight: 500;
  padding: 0.65rem 1.2rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: var(--rose-deep);
  color: #fff;
}

.btn:hover {
  background: #b34f6c;
}

.entry-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.entry-item {
  padding: 1rem 1.05rem;
  background: var(--card);
  border: 1px solid rgba(217, 123, 146, 0.18);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(196, 95, 122, 0.06);
}

.entry-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.entry-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.entry-date {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.entry-meta {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--rose-deep);
}

.entry-note {
  margin-top: 0.55rem;
  white-space: pre-wrap;
}

.entry-note--sweet {
  margin-top: 0.65rem;
  font-size: 1.02rem;
  line-height: 1.8;
}

.entry-item--sweet .entry-top {
  margin-bottom: 0.15rem;
}

.entry-resolve {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(217, 123, 146, 0.3);
  color: var(--muted);
  font-size: 0.92rem;
}

.entry-actions { margin-top: 0.7rem; }

.btn-delete {
  font: inherit;
  font-size: 0.8rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(143, 117, 132, 0.35);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
}

.empty {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 0.4rem 0.2rem 1rem;
}

.anni-toolbar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.sort-hint {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.sort-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.sort-chip {
  font: inherit;
  font-size: 0.72rem;
  line-height: 1;
  color: var(--muted);
  background: rgba(255, 252, 253, 0.85);
  border: 1px solid rgba(217, 123, 146, 0.22);
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.sort-chip:hover {
  color: var(--rose-deep);
  border-color: rgba(217, 123, 146, 0.45);
  transform: translateY(-1px);
}

.sort-chip.is-active {
  color: #fff;
  background: linear-gradient(165deg, #d97b92 0%, #c45f7a 100%);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(196, 95, 122, 0.22);
}

.entry-item.is-pinned {
  border-color: rgba(196, 95, 122, 0.4);
  box-shadow: 0 8px 22px rgba(196, 95, 122, 0.1);
}

.pin-badge {
  display: inline-block;
  margin-right: 0.35rem;
  font-size: 0.72rem;
  color: #fff;
  background: var(--rose-deep);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  vertical-align: middle;
}

.entry-days {
  margin-top: 0.45rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--rose-deep);
  letter-spacing: 0.04em;
}

.entry-actions {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.btn-mini {
  font: inherit;
  font-size: 0.78rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(143, 117, 132, 0.35);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  cursor: pointer;
}

.btn-mini:hover {
  color: var(--rose-deep);
  border-color: var(--rose);
}

.btn-delete:hover {
  color: #b34f6c;
  border-color: #b34f6c;
}

.fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 3.4rem;
  height: 3.4rem;
  border: none;
  border-radius: 50%;
  background: var(--rose-deep);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(196, 95, 122, 0.28);
  z-index: 40;
  transition: transform 0.15s ease, background 0.2s ease;
}

.fab:hover {
  background: #b34f6c;
  transform: scale(1.06);
}

.view-page:not(.is-active) .fab,
.view-page[hidden] .fab {
  display: none;
}

.modal[hidden] { display: none !important; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(61, 47, 56, 0.32);
}

.modal-panel {
  position: relative;
  width: min(420px, 100%);
  background: #fffcfd;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.25rem 1.2rem 1.1rem;
  animation: rise 0.25s ease both;
  box-shadow: 0 20px 50px rgba(196, 95, 122, 0.14);
}

.modal-panel h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--rose-deep);
  margin-bottom: 0.9rem;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.entry-form--modal {
  margin-bottom: 0;
  grid-template-columns: 1fr;
  box-shadow: none;
}

.modal-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

.btn-ghost {
  background: transparent !important;
  color: var(--muted) !important;
  border: 1px solid rgba(143, 117, 132, 0.35);
}

.btn-ghost:hover {
  color: var(--ink) !important;
  border-color: var(--rose);
}

.modal-actions .btn { grid-column: auto; }

.form-hint {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: -0.2rem;
}

.modal-panel--wide {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
}

.photo-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.photo-field-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.photo-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.photo-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(248, 238, 242, 0.55);
  display: grid;
  place-items: center;
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.photo-preview-item button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 1.35rem;
  height: 1.35rem;
  border: none;
  border-radius: 50%;
  background: rgba(61, 47, 56, 0.5);
  color: #fff;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
}

.photo-add-tile {
  aspect-ratio: 1;
  width: 100%;
  border: 1.5px dashed rgba(217, 123, 146, 0.5);
  border-radius: 10px;
  background: rgba(255, 252, 253, 0.55);
  color: var(--rose);
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.photo-add-tile:hover {
  border-color: var(--rose-deep);
  background: rgba(248, 238, 242, 0.95);
  color: var(--rose-deep);
}

.place-photos {
  display: none;
}

.entry-item--place {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.85rem;
}

.place-main {
  flex: 1;
  min-width: 0;
}

.place-stack {
  position: relative;
  flex: 0 0 5.6rem;
  width: 5.6rem;
  height: 5.6rem;
  margin-top: 0.1rem;
  align-self: center;
}

.place-stack-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 10px;
  overflow: hidden;
  background: #f8eef2;
  box-shadow: 0 6px 14px rgba(61, 47, 56, 0.12);
  cursor: zoom-in;
  transform-origin: center center;
  /* 扑克牌式微旋转堆叠 */
  transform: rotate(calc((var(--i, 0) - 1) * 7deg)) translate(calc(var(--i, 0) * 3px), calc(var(--i, 0) * 2px));
  z-index: calc(10 - var(--i, 0));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.place-stack-card:first-child {
  transform: rotate(-4deg);
}

.place-stack-card:hover {
  transform: rotate(0deg) translateY(-4px) scale(1.04);
  z-index: 20;
  box-shadow: 0 10px 20px rgba(196, 95, 122, 0.2);
}

.place-stack-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.place-stack-count {
  position: absolute;
  right: -0.25rem;
  bottom: -0.25rem;
  z-index: 30;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--rose-deep);
  color: #fff;
  font-size: 0.68rem;
  line-height: 1.35rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(196, 95, 122, 0.28);
}

@media (max-width: 520px) {
  .place-stack {
    flex-basis: 4.6rem;
    width: 4.6rem;
    height: 4.6rem;
  }
}

.place-cost {
  margin-top: 0.4rem;
  font-size: 0.92rem;
  color: var(--rose-deep);
}

.place-range {
  font-size: 0.82rem;
  color: var(--muted);
}

.lightbox[hidden] { display: none !important; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(61, 47, 56, 0.55);
  padding: 1rem;
  touch-action: pan-y;
  user-select: none;
}

.lightbox img {
  max-width: min(920px, 100%);
  max-height: 78vh;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  transition: opacity 0.15s ease;
}

.lightbox-close {
  position: absolute;
  top: 0.85rem;
  right: 0.9rem;
  z-index: 2;
  width: 2.4rem;
  height: 2.4rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 252, 253, 0.92);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.6rem;
  height: 2.6rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 252, 253, 0.92);
  color: var(--rose-deep);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(61, 47, 56, 0.16);
}

.lightbox-prev { left: 0.75rem; }
.lightbox-next { right: 0.75rem; }

.lightbox-nav[hidden],
.lightbox-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.lightbox-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 252, 253, 0.9);
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.6rem;
  z-index: 80;
  transform: translateX(-50%) translateY(12px);
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  background: rgba(61, 47, 56, 0.88);
  color: #fff;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 28px rgba(61, 47, 56, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 520px) {
  .lightbox-nav {
    width: 2.2rem;
    height: 2.2rem;
    font-size: 1.45rem;
  }
  .lightbox-prev { left: 0.4rem; }
  .lightbox-next { right: 0.4rem; }

  .toast {
    bottom: 5.2rem;
    max-width: calc(100% - 2rem);
    text-align: center;
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.78; }
}

@media (max-width: 640px) {
  .view-home {
    justify-content: flex-start;
    padding-top: 1.25rem;
    min-height: auto;
  }

  .home-reminders {
    margin-bottom: 1.1rem;
  }

  /* 手机：两列瓷砖，第 5 个居中，字更大更好点 */
  .tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }

  .tile-grid .tile:nth-child(5) {
    grid-column: 1 / -1;
    width: min(48%, 11rem);
    justify-self: center;
  }

  .tile {
    border-radius: 16px;
    gap: 0.4rem;
    min-height: 0;
    padding: 0.35rem;
  }

  .tile-name {
    font-size: 1rem;
    letter-spacing: 0.04em;
  }

  .tile-num {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
  }
}

@media (max-width: 520px) {
  .entry-form { grid-template-columns: 1fr; }

  .toast {
    bottom: 5.2rem;
    max-width: calc(100% - 2rem);
    text-align: center;
  }
}
