/* ============================================================
   我们的日常 · 样式
   奶油底 + 暖玫瑰，移动端优先
   ============================================================ */

:root {
  --cream: #FFF8F4;
  --paper: #FFFFFF;
  --rose: #E8708A;
  --rose-deep: #C94A67;
  --rose-soft: #FBE3E8;
  --peach: #F6B98A;
  --peach-soft: #FFF0E2;
  --ink: #3D2C29;
  --muted: #7C6663;
  --line: #F0E2DA;
  --line-strong: #E7D3C9;
  --danger: #B23A48;
  --shadow: 0 12px 34px rgba(61, 44, 41, 0.07);
  --shadow-sm: 0 2px 10px rgba(61, 44, 41, 0.05);
  --radius: 18px;
  --serif: "Songti SC", "STSong", "SimSun", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 6% -12%, #FFE4DA 0%, rgba(255, 228, 218, 0) 62%),
    radial-gradient(820px 500px at 102% -2%, #FFF0D8 0%, rgba(255, 240, 216, 0) 58%),
    var(--cream);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }

img { max-width: 100%; }

button { font: inherit; color: inherit; }

a { color: var(--rose-deep); text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--rose-deep);
  outline-offset: 2px;
  border-radius: 6px;
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fff;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.6;
}

/* ---------------- 布局骨架 ---------------- */

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 22px 64px;
}

.view { animation: viewIn 0.28s ease both; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 248, 244, 0.82);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid rgba(240, 226, 218, 0.9);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-heart {
  color: var(--rose);
  font-size: 20px;
  animation: beat 3.4s ease-in-out infinite;
}

.brand-text { font-weight: 600; }

@keyframes beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.18); }
  24% { transform: scale(1); }
  36% { transform: scale(1.1); }
  48% { transform: scale(1); }
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav a {
  padding: 7px 15px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14.5px;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav a:hover { background: var(--peach-soft); color: var(--ink); }

.nav a.active {
  background: var(--rose-soft);
  color: var(--rose-deep);
  font-weight: 600;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.icon-btn:hover { background: #fff; color: var(--rose-deep); transform: rotate(18deg); }

.modal-head .icon-btn:hover { transform: none; background: #fbf2ee; }

/* ---------------- 通用元素 ---------------- */

.muted { color: var(--muted); }
.small { font-size: 13px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-head h1 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.page-head .muted { margin-top: 2px; font-size: 13.5px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease,
    border-color 0.15s ease, color 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }

.btn.primary {
  background: var(--rose-deep);
  color: #fff;
  box-shadow: 0 8px 18px rgba(201, 74, 103, 0.24);
}

.btn.primary:hover { background: #B94260; }

.btn.ghost {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink);
}

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

.btn.danger { background: var(--danger); color: #fff; }

.btn.danger.ghost {
  background: #fff;
  border-color: #E9C6C9;
  color: var(--danger);
}

.btn.small { min-height: 32px; padding: 5px 13px; font-size: 13px; }

.btn[disabled] { opacity: 0.55; cursor: progress; transform: none; }

.link {
  font-size: 13.5px;
  color: var(--rose-deep);
  border-bottom: 1px dashed rgba(201, 74, 103, 0.4);
  padding-bottom: 1px;
}

.input {
  width: 100%;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #FFFDFC;
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input::placeholder { color: #B7A29D; }

.input:focus {
  outline: none;
  background: #fff;
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(232, 112, 138, 0.12);
}

textarea.input { resize: vertical; min-height: 84px; line-height: 1.6; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chips:empty { display: none; }

.chip {
  padding: 5px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.16s ease;
}

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

.chip.active {
  background: var(--rose-soft);
  border-color: rgba(232, 112, 138, 0.5);
  color: var(--rose-deep);
  font-weight: 600;
}

.chips.months .chip {
  padding: 3px 11px;
  font-size: 12.5px;
  border-style: dashed;
  background: transparent;
}

/* ---------------- 首页 ---------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 46px 28px 36px;
  border: 1px solid #F7E6DE;
  border-radius: 28px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF5F0 100%);
  box-shadow: var(--shadow);
  text-align: center;
}

.hero-glow {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -150px;
  height: 300px;
  background: radial-gradient(closest-side, rgba(232, 112, 138, 0.16), rgba(232, 112, 138, 0));
  pointer-events: none;
}

.hero-kicker {
  position: relative;
  color: var(--muted);
  font-size: 13.5px;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
}

.hero-days {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 6px;
  font-family: var(--serif);
  color: var(--rose-deep);
  line-height: 1;
}

.hero-days > span:first-child {
  font-size: clamp(64px, 13vw, 116px);
  font-weight: 500;
  letter-spacing: -0.02em;
  animation: breath 5s ease-in-out infinite;
}

.hero-unit { font-size: 22px; color: var(--rose); letter-spacing: 0.1em; }

@keyframes breath {
  0%, 100% { transform: scale(1); text-shadow: 0 10px 30px rgba(201, 74, 103, 0.12); }
  50% { transform: scale(1.02); text-shadow: 0 14px 38px rgba(201, 74, 103, 0.2); }
}

.hero-sub { position: relative; color: var(--muted); font-size: 14px; }

.hero-quote {
  position: relative;
  display: inline-block;
  margin-top: 22px;
  padding: 9px 18px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--rose-deep);
  font-family: var(--serif);
  font-size: 15px;
}

.hero-quote:empty { display: none; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-sm);
}

.stat-num {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.2;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat-label { font-size: 12.5px; color: var(--muted); letter-spacing: 0.04em; }

.home-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 16px;
}

.panel {
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.panel-tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--peach-soft);
  color: #9A6534;
  font-size: 11.5px;
}

.recent-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  min-height: 80px;
}

.recent-photos a {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--peach-soft);
}

.recent-photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.recent-photos a:hover img { transform: scale(1.05); }

.recent-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 80px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
}

.recent-photos a.recent-empty {
  aspect-ratio: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background: transparent;
  overflow: visible;
  text-align: center;
}

.anniv { padding: 6px 2px 10px; }

.anniv-name {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--rose-deep);
}

.anniv-days {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 46px;
  line-height: 1.15;
  color: var(--ink);
}

.anniv-unit { font-size: 15px; color: var(--muted); font-family: var(--sans); }

.anniv-today { color: var(--rose-deep); font-size: 22px !important; }

.privacy-note {
  margin-top: 26px;
  text-align: center;
  font-size: 12px;
  color: #A08A86;
  letter-spacing: 0.03em;
}

/* ---------------- 照片墙 ---------------- */

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 13px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  transition: all 0.18s ease;
}

.dropzone-icon { font-size: 16px; }

.dropzone-text { line-height: 1.7; }

.drop-hint { white-space: nowrap; }

.dropzone.dragover {
  border-color: var(--rose);
  background: var(--rose-soft);
  color: var(--rose-deep);
  transform: scale(1.005);
}

.timeline { display: flex; flex-direction: column; gap: 26px; }

.tl-group { scroll-margin-top: 90px; }

.tl-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.tl-head h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.tl-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), rgba(240, 226, 218, 0));
}

.tl-count { font-size: 12px; color: #A08A86; white-space: nowrap; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}

.photo-card {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(61, 44, 41, 0.09);
}

.photo-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  background: var(--peach-soft);
  cursor: zoom-in;
  overflow: hidden;
}

.photo-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.photo-card:hover .photo-thumb img { transform: scale(1.04); }

.photo-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px 10px;
}

.photo-time {
  font-size: 11.5px;
  color: var(--rose-deep);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.photo-caption {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.photo-caption:empty { display: none; }

.photo-meta {
  font-size: 11.5px;
  color: #A08A86;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-meta:empty { display: none; }

.card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 5px;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.photo-card:hover .card-actions,
.photo-card:focus-within .card-actions { opacity: 1; transform: none; }

.card-actions button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: rgba(61, 44, 41, 0.55);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.16s ease;
}

.card-actions button:hover { background: rgba(61, 44, 41, 0.85); }

/* 空状态 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 54px 20px;
  text-align: center;
}

.empty-art { display: flex; align-items: flex-end; gap: 7px; height: 46px; margin-bottom: 14px; }

.empty-art span {
  display: block;
  width: 26px;
  border-radius: 5px 5px 3px 3px;
  background: #FBE3E8;
  transform: rotate(-8deg);
}

.empty-art span:nth-child(1) { height: 34px; }
.empty-art span:nth-child(2) { height: 46px; background: #FFEBD9; transform: rotate(4deg); }
.empty-art span:nth-child(3) { height: 28px; transform: rotate(11deg); }

.empty-title { font-family: var(--serif); font-size: 17px; }

.empty-text { margin-top: 4px; color: var(--muted); font-size: 13px; }

/* ---------------- 大图查看 ---------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 23, 22, 0.93);
  animation: fadeIn 0.2s ease both;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 90vw;
  margin: 0;
}

.lb-figure img {
  max-width: 90vw;
  max-height: 72vh;
  border-radius: 10px;
  object-fit: contain;
  background: #2A1E1D;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.lb-caption { text-align: center; max-width: 640px; }

.lb-text { color: #FFF3EE; font-family: var(--serif); font-size: 16px; }

.lb-text:empty { display: none; }

.lb-meta { color: rgba(255, 243, 238, 0.62); font-size: 12.5px; margin-top: 3px; }

.lb-close, .lb-nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #FFF3EE;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.18s ease;
}

.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, 0.2); }

.lb-close { top: 18px; right: 18px; font-size: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

.lb-counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 243, 238, 0.65);
  font-size: 12.5px;
  letter-spacing: 0.1em;
}

/* ---------------- 小游戏 ---------------- */

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  align-items: start;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-sm);
}

.game-card { padding: 16px; }

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

.game-head h2 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.game-head .muted { font-size: 12.5px; margin-top: 1px; }

.game-best {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--peach-soft);
  color: #9A6534;
  font-size: 12px;
  white-space: nowrap;
}

.game-best b { font-variant-numeric: tabular-nums; }

.game-stage {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(180deg, #FFF6F1 0%, #FFEFE6 100%);
  border: 1px solid #F8E7DE;
}

#hc-canvas {
  display: block;
  width: 100%;
  height: 340px;
  touch-action: none;
  cursor: none;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  background: #fff8f4;
}

.overlay-title { font-family: var(--serif); font-size: 21px; color: var(--ink); }

.overlay-text { color: var(--muted); font-size: 13px; max-width: 260px; }

.game-overlay .btn { margin-top: 10px; }

.game-hud {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 12.5px;
}

.game-hud b {
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.game-hud .btn { margin-left: auto; }

.memory-stage {
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.mcard {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid #F2DCD2;
  border-radius: 12px;
  background: linear-gradient(160deg, #FFFFFF, #FFF1EA);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

.mcard:hover { transform: translateY(-1px); border-color: var(--peach); }

.mcard-front, .mcard-back {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.mcard-front { color: #E7BCA9; font-size: 15px; }

.mcard-back {
  opacity: 0;
  transform: scale(0.6);
  font-size: 26px;
  background: #fff;
}

.mcard.flipped .mcard-front { opacity: 0; }
.mcard.flipped .mcard-back { opacity: 1; transform: scale(1); }

.mcard.matched {
  border-color: rgba(232, 112, 138, 0.55);
  background: var(--rose-soft);
  animation: pop 0.3s ease;
}

@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.mcard.done { cursor: default; }

/* ---------------- 备忘录 ---------------- */

.memo-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.memo-toolbar .input { flex: 1; min-width: 160px; }

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
}

.segmented button {
  padding: 5px 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.segmented button.active {
  background: var(--rose-soft);
  color: var(--rose-deep);
  font-weight: 600;
}

.memo-list { display: flex; flex-direction: column; gap: 9px; }

.memo-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, transform 0.15s ease;
}

.memo-item:hover { border-color: #EBD5CB; transform: translateY(-1px); }

.memo-item.is-done { background: rgba(255, 255, 255, 0.55); }

.memo-check {
  flex: none;
  width: 21px;
  height: 21px;
  margin-top: 2px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: transparent;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.18s ease;
}

.memo-check:hover { border-color: var(--rose); }

.memo-item.is-done .memo-check {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
}

.memo-body { flex: 1; min-width: 0; }

.memo-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  word-break: break-word;
}

.memo-item.is-done .memo-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(124, 102, 99, 0.5);
}

.memo-content {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.memo-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

.badge {
  padding: 1.5px 8px;
  border-radius: 999px;
  background: #FBF2EE;
  color: #8A6E68;
  font-size: 11.5px;
  white-space: nowrap;
}

.badge.cat { background: var(--rose-soft); color: var(--rose-deep); }

.badge.overdue { background: #FDECEC; color: var(--danger); font-weight: 600; }

.badge.remind { background: #EEF4FD; color: #3F6CA6; }

.memo-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.16s ease; }

.memo-item:hover .memo-actions,
.memo-item:focus-within .memo-actions { opacity: 1; }

.memo-actions button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.memo-actions button:hover { background: #FBF2EE; color: var(--rose-deep); }

.memo-foot { display: flex; justify-content: flex-end; margin-top: 14px; }

/* ---------------- 弹窗与表单 ---------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(61, 44, 41, 0.42);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.18s ease both;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 20px 22px 18px;
  border: 1px solid #F6E3D9;
  border-radius: 22px;
  background: var(--cream);
  box-shadow: 0 30px 80px rgba(61, 44, 41, 0.24);
  animation: modalIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.modal-card.small { max-width: 380px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.modal-head h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.form { display: flex; flex-direction: column; gap: 13px; }

.field { display: flex; flex-direction: column; gap: 5px; }

.field > span { font-size: 13px; color: var(--muted); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.hint { color: #A08A86; font-size: 11.5px; }

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.modal-actions .spacer { flex: 1; }

.confirm-text { padding: 6px 2px 2px; font-size: 15px; line-height: 1.6; }

.settings-block {
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
}

.settings-block h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* ---------------- 提示条 ---------------- */

.toasts {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: 320px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: 0 12px 30px rgba(61, 44, 41, 0.14);
  animation: toastIn 0.24s ease both;
}

.toast.warn { border-color: #F3D3B4; background: #FFF8EF; }
.toast.error { border-color: #EFC7CB; background: #FFF5F5; color: var(--danger); }
.toast.leaving { animation: toastOut 0.22s ease both; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(6px); }
}

/* ---------------- 底部导航（默认隐藏） ---------------- */

.tabbar { display: none; }

/* ---------------- 响应式 ---------------- */

@media (max-width: 860px) {
  .home-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 14.5px; }

  .container { padding: 18px 16px calc(84px + env(safe-area-inset-bottom)); }

  .topbar-inner { padding: 8px 16px; }
  .brand-text { font-size: 17px; }
  .nav { display: none; }
  .topbar-inner #btn-lock { margin-left: auto; }

  .page-head { align-items: center; margin-bottom: 16px; }
  .page-head h1 { font-size: 24px; }
  .page-head .muted { font-size: 12.5px; }

  .hero { padding: 34px 18px 28px; border-radius: 22px; }
  .hero-kicker { font-size: 12px; letter-spacing: 0.26em; }
  .hero-quote { font-size: 13.5px; padding: 7px 14px; }

  .stat-num { font-size: 24px; }
  .stat-card { padding: 13px 6px 12px; }

  .dropzone { font-size: 12px; padding: 11px 12px; }
  .dropzone span:last-child { line-height: 1.5; }
  .drop-hint { display: none; }

  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 9px; }
  .photo-info { padding: 7px 9px 8px; }
  .card-actions { opacity: 1; transform: none; }

  .games-grid { grid-template-columns: 1fr; }

  .memo-toolbar { flex-wrap: wrap; }
  .memo-toolbar .input { width: 100%; flex: 1 0 100%; }
  .memo-actions { opacity: 1; }

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

  .modal { padding: 12px; align-items: flex-end; }
  .modal-card { max-height: 92vh; border-radius: 20px; padding: 18px 16px 16px; }

  .toasts {
    left: 12px;
    right: 12px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    align-items: stretch;
  }
  .toast { max-width: none; }

  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
  .lb-close { top: 12px; right: 12px; }
  .lb-figure img { max-width: 94vw; max-height: 66vh; }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 250, 247, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }

  .tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 4px 0 3px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 10.5px;
  }

  .tabbar a span { font-size: 18px; line-height: 1.35; filter: grayscale(1) opacity(0.55); }

  .tabbar a.active { color: var(--rose-deep); }
  .tabbar a.active span { filter: none; }

  .tabbar i { font-style: normal; }
}

@media (max-width: 380px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-days > span:first-child { font-size: 58px; }
  .segmented button { padding: 5px 9px; }
}

@media (hover: none) {
  .card-actions, .memo-actions { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .hero-days > span:first-child { animation: none; }
}

/* ---------------- 收尾修正 ---------------- */

body.is-locked { overflow: hidden; }

.lb-nav[disabled] { opacity: 0.28; cursor: default; }

.recent-photos a,
.recent-photos .recent-empty {
  color: var(--muted);
  text-decoration: none;
}

.toast.info { border-color: var(--line); }

/* ---------------- 本地密码锁 ---------------- */

html:not(.authed) body { overflow: hidden; }

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  padding: 24px 18px;
  overflow-y: auto;
  background:
    radial-gradient(720px 420px at 8% 0%, #FFE3D8 0%, rgba(255, 227, 216, 0) 62%),
    radial-gradient(720px 460px at 100% 8%, #FFF0D6 0%, rgba(255, 240, 214, 0) 58%),
    var(--cream);
}

html.authed .auth-screen { display: none; }

.auth-card {
  width: 100%;
  max-width: 400px;
  margin: auto;
  padding: 30px 28px 22px;
  border: 1px solid #F7E6DE;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 30px 80px rgba(61, 44, 41, 0.12);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.auth-heart {
  color: var(--rose);
  font-size: 20px;
  animation: beat 3.4s ease-in-out infinite;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form h1 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.35;
}

.auth-sub {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  text-align: center;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-field > span {
  font-size: 12.5px;
  color: var(--muted);
}

.auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
}

.auth-error,
.form-error {
  margin: 0;
  padding: 7px 11px;
  border-radius: 9px;
  background: #fdf0f1;
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.55;
}

.auth-hint {
  margin: 0;
  padding: 6px 11px;
  border-radius: 9px;
  background: #fbf2ee;
  color: #8a6e68;
  font-size: 12.5px;
}

.auth-links {
  text-align: center;
}

.auth-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-link:hover { color: var(--rose-deep); }

.auth-note {
  margin-top: 2px;
  color: #a08a86;
  font-size: 11.5px;
  line-height: 1.65;
  text-align: center;
}

.auth-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.auth-row .btn { flex: 1; }

.auth-foot {
  margin-top: 18px;
  text-align: center;
  color: #b7a29d;
  font-size: 11px;
  letter-spacing: 0.08em;
}

#btn-lock span { display: grid; place-items: center; }
#btn-lock svg { display: block; }

@media (max-width: 420px) {
  .auth-screen { padding: 16px 12px; }
  .auth-card { padding: 24px 18px 18px; border-radius: 20px; }
  .auth-form h1 { font-size: 21px; }
}


