/* ============================================================
   小远和他的小宝的时光日记 —— 温馨木质麻绳拍立得
   ============================================================ */

:root {
  --wood-1: #7a5233;
  --wood-2: #573a26;
  --wood-3: #39251a;
  --cream: #f8efe0;
  --cream-2: #f1e2ca;
  --ink: #40291a;
  --ink-2: #6b4a30;
  --ink-3: #8a6a4c;
  --accent: #c9763f;
  --accent-2: #e08a4e;
  --rose: #d76a86;
  --gold: #e8c07a;
  --green: #7fa86b;
  --hand: "Ma Shan Zheng", "STKaiti", "KaiTi", "Kaiti SC", "楷体", "Noto Serif SC", serif;
  --body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB", system-ui, sans-serif;
  --radius: 14px;
  --shadow-card: 0 18px 38px rgba(18, 9, 3, 0.42), 0 2px 6px rgba(18, 9, 3, 0.3);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--body);
  color: var(--cream);
  background: #3a2618;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------------- 背景：木板墙 + 暖光 + 颗粒 ---------------- */
.wood-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: #4a3222;
  background-image:
    radial-gradient(1100px 620px at 18% -8%, rgba(255, 196, 120, 0.40), rgba(255, 196, 120, 0) 62%),
    radial-gradient(900px 520px at 88% 4%, rgba(255, 150, 90, 0.17), rgba(255, 150, 90, 0) 64%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0 3px, rgba(255, 255, 255, 0) 3px 8px),
    repeating-linear-gradient(90deg, rgba(255, 235, 200, 0.045) 0 1px, rgba(255, 255, 255, 0) 1px 138px, rgba(0, 0, 0, 0.26) 138px 141px, rgba(255, 255, 255, 0) 141px 146px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.07) 0 2px, rgba(255, 255, 255, 0) 2px 7px, rgba(255, 220, 180, 0.028) 7px 9px),
    linear-gradient(180deg, #7a5233 0%, #573a26 45%, #39251a 100%);
}
.wood-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 28%, rgba(0, 0, 0, 0) 38%, rgba(18, 8, 3, 0.58) 100%);
}
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/></filter><rect width='220' height='220' filter='url(%23n)' opacity='0.6'/></svg>");
}
.lamp {
  position: fixed;
  top: -26vh;
  left: 50%;
  transform: translateX(-50%);
  width: 82vw;
  height: 82vh;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 42%, rgba(255, 205, 140, 0.30), rgba(255, 205, 140, 0) 62%);
  filter: blur(14px);
  animation: lamp-breathe 9s ease-in-out infinite alternate;
}
@keyframes lamp-breathe {
  from { opacity: 0.78; }
  to { opacity: 1; }
}

.screen, #app, .modal, #toast { position: relative; z-index: 2; }

/* ---------------- 通用 ---------------- */
.muted { color: var(--ink-3); }
.muted-light { color: rgba(248, 231, 198, 0.62); }
.small { font-size: 0.78rem; }
.error { color: #b23b2e; font-size: 0.85rem; margin: 10px 0 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 10px 18px;
  border: 1px solid rgba(120, 80, 45, 0.3);
  background: linear-gradient(180deg, #fdf8ee, #f2e5d0);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.03); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(180deg, #d68f55, #b06a37);
  color: #fff7ea;
  border-color: #8d5227;
  box-shadow: 0 8px 20px rgba(130, 66, 20, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn-ghost {
  background: rgba(255, 248, 236, 0.12);
  color: #f6e6c9;
  border-color: rgba(248, 231, 198, 0.28);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: rgba(255, 248, 236, 0.2); }
.btn-ghost-dark {
  background: rgba(74, 47, 29, 0.06);
  color: var(--ink);
  border-color: rgba(120, 80, 45, 0.28);
  box-shadow: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-block { display: block; width: 100%; }
.btn-icon { padding: 10px 13px; font-size: 1rem; }

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-3);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}
input[type="text"], input[type="password"], input[type="date"], input:not([type]), textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid rgba(120, 80, 45, 0.28);
  background: rgba(255, 252, 246, 0.92);
  font: inherit;
  font-size: 0.94rem;
  color: #3f2a1a;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(201, 118, 63, 0.16);
}
textarea { resize: vertical; min-height: 78px; line-height: 1.6; }

/* ---------------- 登录 / 初始化 ---------------- */
.screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 26px 18px; }
.login-card {
  width: min(386px, 100%);
  background: linear-gradient(180deg, #fdf7ea, #f2e3c9);
  border-radius: 18px;
  padding: 34px 30px 28px;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(120, 80, 45, 0.24);
  color: var(--ink);
  position: relative;
  animation: card-in 0.5s ease both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(0.985); } to { opacity: 1; transform: none; } }
.login-ornament {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #d98d55, #b06a37);
  color: #fff3df;
  font-size: 1.25rem;
  box-shadow: 0 8px 18px rgba(110, 55, 18, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.login-title {
  font-family: var(--hand);
  font-size: 1.42rem;
  line-height: 1.35;
  text-align: center;
  margin: 10px 0 6px;
  color: #4a2f1d;
  letter-spacing: 0.02em;
}
.login-sub { text-align: center; color: var(--ink-3); font-size: 0.82rem; margin: 0 0 22px; }
.identity-label { font-size: 0.76rem; font-weight: 700; color: var(--ink-3); margin: 18px 0 8px; letter-spacing: 0.03em; }
.identity-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 13px 8px;
  border-radius: 13px;
  border: 2px solid rgba(120, 80, 45, 0.16);
  background: rgba(255, 253, 248, 0.6);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}
.identity:hover { border-color: rgba(201, 118, 63, 0.5); }
.identity.active {
  border-color: var(--accent);
  background: #fff8ea;
  box-shadow: 0 0 0 4px rgba(201, 118, 63, 0.14);
}
.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--hand);
  font-size: 1.25rem;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 4px 10px rgba(60, 30, 10, 0.25);
}
.av-a { background: linear-gradient(140deg, #e08a9b, #c1566f); }
.av-b { background: linear-gradient(140deg, #e3b16f, #b47a37); }
.id-name { font-size: 0.92rem; font-weight: 700; color: var(--ink); }

/* ---------------- 主界面 ---------------- */
.topbar {
  max-width: 1140px;
  margin: 0 auto;
  padding: 22px 22px 4px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.brand-title {
  font-family: var(--hand);
  font-size: 1.72rem;
  color: #fbeacb;
  text-shadow: 0 2px 14px rgba(20, 8, 2, 0.6);
  letter-spacing: 0.02em;
  line-height: 1.25;
}
.brand-sub { font-size: 0.76rem; color: rgba(248, 231, 198, 0.6); margin-top: 4px; letter-spacing: 0.04em; }
.top-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.me-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.14);
  border: 1px solid rgba(248, 231, 198, 0.24);
  color: #f8e7c6;
  font-size: 0.8rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.hero {
  max-width: 1140px;
  margin: 18px auto 0;
  padding: 0 22px;
  display: grid;
  grid-template-columns: 1fr 1.55fr 1fr;
  gap: 14px;
}
.hero-cell {
  background: linear-gradient(180deg, rgba(253, 247, 236, 0.97), rgba(242, 228, 205, 0.95));
  border-radius: var(--radius);
  padding: 16px 20px;
  color: var(--ink);
  border: 1px solid rgba(120, 80, 45, 0.2);
  box-shadow: 0 16px 34px rgba(20, 10, 4, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  position: relative;
  overflow: hidden;
}
.hero-cell::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(150, 100, 60, 0.35) 0 6px, transparent 6px 12px);
}
.hero-label { font-size: 0.74rem; font-weight: 700; color: var(--ink-3); letter-spacing: 0.08em; }
.hero-num {
  font-family: var(--hand);
  font-size: 2.5rem;
  line-height: 1.1;
  color: #5a3620;
  margin: 4px 0 2px;
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.hero-num small { font-family: var(--body); font-size: 0.8rem; font-weight: 600; color: var(--ink-3); }
.hero-num.small { font-size: 2rem; }
.hero-sub { font-size: 0.74rem; color: var(--ink-3); line-height: 1.5; }

.hero-favor .hero-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 0.86rem; }
.hero-favor .hero-row b { color: #8f4a22; font-size: 0.98rem; }
.hero-favor .hero-row span { color: var(--ink-3); font-size: 0.78rem; }
.favor-bar {
  position: relative;
  height: 11px;
  border-radius: 999px;
  background: rgba(120, 80, 45, 0.16);
  overflow: hidden;
  margin: 10px 0 8px;
  box-shadow: inset 0 1px 3px rgba(80, 45, 20, 0.25);
}
.favor-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #e08aa0, #d76a86 30%, #e8a45c 75%, #f0cf8b);
  transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.favor-spark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  animation: spark 2.8s ease-in-out infinite;
}
@keyframes spark { 0% { left: -40px; } 55% { left: 100%; } 100% { left: 100%; } }
.contrib { font-size: 0.71rem; color: var(--ink-3); margin-top: 8px; letter-spacing: 0.01em; }

.hero-streak { text-align: center; }
.hero-streak .flame {
  font-size: 1.6rem;
  line-height: 1;
  filter: grayscale(0.75) opacity(0.75);
  transform-origin: 50% 80%;
  transition: all 0.4s ease;
}
.hero-streak .flame.lit {
  filter: none;
  animation: flicker 1.6s ease-in-out infinite alternate;
}
.hero-streak .flame.hot { font-size: 1.9rem; filter: drop-shadow(0 0 12px rgba(255, 150, 60, 0.75)); }
@keyframes flicker {
  from { transform: scale(1) rotate(-2deg); }
  to { transform: scale(1.09) rotate(2deg); }
}
.hero-streak .hero-num { justify-content: center; }
.hero-streak .hero-sub { margin-top: 4px; }
.checkin-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.checkin-chip {
  font-size: 0.68rem;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(120, 80, 45, 0.2);
  background: rgba(255, 252, 246, 0.7);
  color: var(--ink-3);
}
.checkin-chip.done { background: rgba(127, 168, 107, 0.16); border-color: rgba(127, 168, 107, 0.45); color: #4d6b3c; font-weight: 700; }

/* ---------------- 标签页 ---------------- */
.tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 20px auto 0;
  padding: 6px;
  border-radius: 999px;
  background: rgba(30, 16, 8, 0.22);
  border: 1px solid rgba(248, 231, 198, 0.18);
  backdrop-filter: blur(8px);
  width: fit-content;
  max-width: calc(100% - 36px);
}
.tab {
  border: 0;
  background: transparent;
  color: rgba(248, 231, 198, 0.78);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.tab:hover { color: #fdf3e2; background: rgba(255, 248, 236, 0.08); }
.tab.active {
  background: linear-gradient(180deg, #fdf7ea, #efdfc4);
  color: #52331f;
  box-shadow: 0 4px 12px rgba(15, 8, 2, 0.3);
}

.main { max-width: 1140px; margin: 0 auto; padding: 22px 22px 90px; }
.panel { animation: fade-up 0.35s ease both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------- 照片墙 ---------------- */
.wall { position: relative; }
.rope-row { position: relative; margin-bottom: 44px; padding-top: 34px; }
.rope-row:last-child { margin-bottom: 10px; }
.rope {
  position: absolute;
  left: -10px;
  top: 0;
  width: calc(100% + 20px);
  height: 60px;
  overflow: visible;
  pointer-events: none;
}
.rope .rope-line { fill: none; stroke: #cbaa78; stroke-width: 4.5; stroke-linecap: round; }
.rope .rope-twist { fill: none; stroke: rgba(92, 60, 30, 0.42); stroke-width: 2; stroke-dasharray: 3 5; }
.rope .rope-shadow { fill: none; stroke: rgba(15, 7, 2, 0.32); stroke-width: 7; transform: translateY(4px); }

.hangers {
  display: grid;
  grid-template-columns: repeat(var(--per-row, 4), minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.hanger { position: relative; display: flex; justify-content: center; transform: translateY(var(--drop, 0px)); }
.peg {
  position: absolute;
  top: -15px;
  left: 50%;
  width: 19px;
  height: 31px;
  transform: translateX(-50%);
  z-index: 3;
  border-radius: 4px 4px 3px 3px;
  background: linear-gradient(90deg, #a06a38, #dcae74 42%, #a9743f 70%, #7d4f26);
  box-shadow: 0 3px 6px rgba(10, 4, 1, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.peg::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 3px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(90deg, #b98347, #e3bb84 50%, #b9854b);
  opacity: 0.75;
}
.peg::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 17px;
  height: 2px;
  border-radius: 2px;
  background: rgba(58, 33, 14, 0.7);
  box-shadow: 0 -7px 0 -1px rgba(255, 240, 210, 0.28);
}
.peg.big { width: 24px; height: 38px; top: -19px; }

.polaroid {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 7px 7px 0;
  background: linear-gradient(180deg, #fefaf2, #f4e9d6);
  border-radius: 2px;
  box-shadow: 0 15px 26px rgba(16, 7, 2, 0.45), 0 2px 5px rgba(16, 7, 2, 0.35);
  transform: rotate(var(--tilt, 0deg));
  transform-origin: 50% -14px;
  animation: sway var(--sway, 9s) ease-in-out var(--delay, 0s) infinite alternate;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  cursor: pointer;
  will-change: transform;
}
@keyframes sway {
  from { transform: rotate(calc(var(--tilt, 0deg) - 0.55deg)); }
  to { transform: rotate(calc(var(--tilt, 0deg) + 0.55deg)); }
}
.polaroid:hover {
  animation-play-state: paused;
  transform: rotate(0deg) translateY(-6px) scale(1.035);
  box-shadow: 0 24px 40px rgba(16, 7, 2, 0.52), 0 3px 9px rgba(16, 7, 2, 0.4);
  z-index: 6;
}
.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #2a1a12;
  filter: saturate(0.97) contrast(0.99) sepia(0.03);
}
.polaroid figcaption, .polaroid-caption {
  font-family: var(--hand);
  font-size: 0.9rem;
  line-height: 1.35;
  color: #5a3d26;
  padding: 8px 4px 10px;
  min-height: 38px;
  text-align: center;
}
.polaroid figcaption {
  display: block;
  overflow: visible;
}
.polaroid figcaption .cap {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.photo-meta {
  display: block;
  margin-top: 5px;
  font-family: var(--body);
  font-size: 0.6rem;
  color: rgba(120, 90, 60, 0.62);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo-tagline {
  position: absolute;
  right: 8px;
  bottom: 5px;
  font-family: var(--body);
  font-size: 0.6rem;
  color: rgba(120, 90, 60, 0.65);
  letter-spacing: 0.02em;
}
.photo-hearts {
  position: absolute;
  left: 8px;
  bottom: 4px;
  font-size: 0.66rem;
  color: #c46a7f;
  font-family: var(--body);
}
.polaroid .photo-actions { display: none; }

.wall-empty { display: flex; justify-content: center; padding: 46px 10px 20px; }
.empty-note {
  background: linear-gradient(180deg, #fdf7ea, #f1e1c6);
  color: var(--ink);
  padding: 30px 40px 28px;
  border-radius: 4px;
  transform: rotate(-1.1deg);
  box-shadow: var(--shadow-card);
  text-align: center;
  font-family: var(--hand);
  font-size: 1.18rem;
  max-width: 330px;
}
.empty-emoji { font-size: 1.7rem; margin-bottom: 6px; }
.empty-sub { font-family: var(--body); font-size: 0.78rem; color: var(--ink-3); margin: 6px 0 16px; }
.wall-more { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0 4px; }

/* ---------------- 时光轴 ---------------- */
.timeline { position: relative; max-width: 1020px; margin: 0 auto; padding: 10px 0 6px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-1px);
  background: linear-gradient(180deg, rgba(248, 231, 198, 0), rgba(248, 231, 198, 0.42) 6%, rgba(248, 231, 198, 0.3) 92%, rgba(248, 231, 198, 0));
}
.tl-day {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 118px 1fr;
  align-items: start;
  margin-bottom: 30px;
}
.tl-day:last-child { margin-bottom: 6px; }
.tl-date {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6px;
  text-align: center;
  color: #f7e8ca;
}
.tl-date::after {
  content: "";
  width: 9px;
  height: 9px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(232, 192, 122, 0.16);
}
.tl-date b { font-family: var(--hand); font-size: 1rem; line-height: 1.2; white-space: nowrap; }
.tl-weekday { font-size: 0.6rem; color: rgba(246, 230, 201, 0.6); line-height: 1.45; display: block; margin-top: 3px; white-space: nowrap; }
.tl-photos { grid-column: 1; grid-row: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; padding-right: 30px; }
.tl-day.tl-right .tl-photos { grid-column: 3; padding-right: 0; padding-left: 30px; }
.tl-photos .tl-item { justify-self: stretch; }
.tl-day:only-child .tl-photos { justify-content: center; }
.tl-item {
  background: var(--cream);
  padding: 6px 6px 0;
  border-radius: 2px;
  box-shadow: 0 10px 22px rgba(16, 7, 2, 0.4);
  transform: rotate(-0.7deg);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  margin: 0;
  position: relative;
}
.tl-item:nth-child(even) { transform: rotate(0.7deg); }
.tl-item:hover { transform: rotate(0deg) translateY(-4px); box-shadow: 0 18px 30px rgba(16, 7, 2, 0.5); }
.tl-item img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.tl-item figcaption {
  font-family: var(--hand);
  font-size: 0.8rem;
  color: #5a3d26;
  padding: 6px 3px 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tl-author {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(40, 22, 10, 0.62);
  color: #fdf3e2;
  backdrop-filter: blur(4px);
}

/* ---------------- 小心思 ---------------- */
.notes-wrap { max-width: 780px; margin: 0 auto; display: grid; gap: 24px; }
.note-composer {
  background: linear-gradient(180deg, #fdf6e6, #f2e3c8);
  border-radius: 4px;
  padding: 18px;
  transform: rotate(-0.45deg);
  box-shadow: var(--shadow-card);
  color: var(--ink);
}
.note-composer textarea {
  background: transparent;
  border: 0;
  box-shadow: none;
  font-family: var(--hand);
  font-size: 1.06rem;
  color: #4a3020;
  padding: 4px 2px;
  min-height: 84px;
}
.note-composer textarea:focus { box-shadow: none; border: 0; }
.note-composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; padding-top: 8px; border-top: 1px dashed rgba(120, 80, 45, 0.25); }
.notes-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; align-items: start; }
.note-card {
  background: linear-gradient(180deg, #fdf7ea, #f4e8d0);
  color: var(--ink);
  border-radius: 3px;
  padding: 18px 18px 14px;
  box-shadow: 0 14px 28px rgba(16, 7, 2, 0.4);
  transform: rotate(var(--rot, -0.6deg));
  position: relative;
  transition: transform 0.25s ease;
}
.note-card:hover { transform: rotate(0deg) translateY(-3px); }
.note-card::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 52px;
  height: 17px;
  background: rgba(255, 246, 224, 0.55);
  border: 1px solid rgba(200, 170, 130, 0.35);
  box-shadow: 0 1px 2px rgba(10, 4, 1, 0.18);
}
.note-text { font-family: var(--hand); font-size: 1rem; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.note-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 0.7rem; color: #8a6a4c; }
.note-author { font-weight: 700; }
.note-empty { grid-column: 1 / -1; text-align: center; color: rgba(248, 231, 198, 0.65); font-size: 0.9rem; padding: 26px 0; }

/* ---------------- 页脚 ---------------- */
.foot { max-width: 1140px; margin: 0 auto; padding: 0 22px 34px; text-align: center; color: rgba(248, 231, 198, 0.42); font-size: 0.72rem; letter-spacing: 0.03em; }

/* ---------------- 弹窗 ---------------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 22px; }
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(16, 8, 3, 0.72);
  backdrop-filter: blur(5px);
  animation: mask-in 0.25s ease;
}
@keyframes mask-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(540px, 95vw);
  max-height: 93vh;
  overflow: auto;
  background: linear-gradient(180deg, #fdf8ee, #f1e2c9);
  color: var(--ink);
  border-radius: 16px;
  padding: 26px;
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  animation: pop-in 0.3s cubic-bezier(0.2, 0.9, 0.25, 1.1) both;
  scrollbar-width: thin;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }
.modal-card h2 { margin: 0 0 18px; font-family: var(--hand); font-size: 1.4rem; color: #4a2f1d; }
.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 4;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(74, 47, 29, 0.09);
  color: #6b4a30;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}
.modal-close:hover { background: rgba(74, 47, 29, 0.18); }

/* 照片详情 */
.photo-modal { display: flex; align-items: flex-start; gap: 22px; max-width: min(1000px, 96vw); background: transparent; box-shadow: none; padding: 0; overflow: visible; }
.photo-stage { flex: 1 1 56%; display: flex; justify-content: center; padding-top: 10px; }
.photo-stage .polaroid {
  max-width: min(500px, 52vw);
  transform: rotate(-0.8deg);
  animation: none;
  cursor: default;
  padding: 9px 9px 0;
}
.photo-stage .polaroid img { aspect-ratio: auto; max-height: 64vh; object-fit: contain; background: #1c110a; }
.photo-stage .polaroid-caption { font-size: 1.05rem; min-height: 0; padding: 10px 6px 14px; }
.photo-stage .polaroid-meta { font-family: var(--body); font-size: 0.68rem; color: #97795c; margin-top: 4px; }
.photo-side {
  flex: 1 1 44%;
  background: linear-gradient(180deg, #fdf8ee, #f2e4cc);
  border-radius: 14px;
  padding: 22px 20px 18px;
  max-height: 76vh;
  overflow: auto;
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.detail-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f0d5b4, #e3bd93);
  color: #5c3a1e;
  font-size: 0.76rem;
  font-weight: 700;
}
.detail-mood { font-family: var(--hand); font-size: 0.95rem; color: #7a5638; margin: 10px 0 6px; }
.like-btn {
  margin: 8px 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(196, 106, 127, 0.35);
  background: rgba(255, 250, 244, 0.9);
  color: #b04f66;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.2s ease;
  position: relative;
}
.like-btn:hover { transform: scale(1.04); }
.like-btn.liked { background: linear-gradient(180deg, #f6cad4, #efb2c1); border-color: rgba(180, 80, 105, 0.5); }
.like-btn.pop { animation: like-pop 0.42s ease; }
@keyframes like-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.14); }
  70% { transform: scale(0.97); }
  100% { transform: scale(1); }
}
.comments { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.comment {
  background: rgba(255, 252, 246, 0.75);
  border: 1px solid rgba(150, 110, 70, 0.16);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #4a3020;
}
.comment b { color: #8f4a22; font-size: 0.78rem; margin-right: 6px; }
.comment .c-time { display: block; font-size: 0.66rem; color: #a98d70; margin-top: 3px; }
.comment-empty { font-size: 0.8rem; color: #a98d70; text-align: center; padding: 14px 0; }
.comment-form { display: flex; gap: 8px; }
.comment-form input { flex: 1; }
.comment-form .btn { padding: 9px 16px; }
.detail-foot { margin-top: 12px; text-align: right; }
.link-danger { border: 0; background: transparent; color: #b23b2e; font-size: 0.76rem; cursor: pointer; padding: 4px; }
.link-danger:hover { text-decoration: underline; }

/* 上传 */
.upload-modal { max-width: min(560px, 95vw); }
.drop-zone {
  position: relative;
  border: 2px dashed rgba(150, 100, 60, 0.4);
  border-radius: 12px;
  min-height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  margin-bottom: 16px;
  background: rgba(255, 252, 246, 0.55);
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.drop-zone:hover, .drop-zone.drag { border-color: var(--accent); background: rgba(255, 248, 235, 0.9); }
.drop-hint { padding: 22px; color: var(--ink-3); font-size: 0.86rem; line-height: 1.75; }
.drop-hint small { color: #a98d70; font-size: 0.72rem; }
.drop-icon { font-size: 1.9rem; margin-bottom: 6px; }
#upload-preview { display: block; max-width: 100%; max-height: 320px; object-fit: contain; }
.mood-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mood-chip {
  border: 1px solid rgba(120, 80, 45, 0.24);
  background: rgba(255, 252, 246, 0.8);
  border-radius: 999px;
  padding: 6px 13px;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.18s ease;
}
.mood-chip:hover { border-color: rgba(201, 118, 63, 0.5); }
.mood-chip.active { background: linear-gradient(180deg, #f6d9c2, #eec6a8); border-color: rgba(201, 118, 63, 0.7); color: #6b3a1a; font-weight: 700; }

/* 设置 */
.settings-modal { max-width: min(560px, 95vw); }
.settings-block { margin: 18px 0 6px; padding-top: 16px; border-top: 1px dashed rgba(120, 80, 45, 0.25); }
.settings-title { font-size: 0.78rem; font-weight: 700; color: var(--ink-3); margin-bottom: 10px; letter-spacing: 0.04em; }
.settings-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.settings-links .btn { font-size: 0.8rem; padding: 9px 14px; }
#set-data-dir { word-break: break-all; margin: 16px 0 0; line-height: 1.5; }

/* ---------------- Toast ---------------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(38, 22, 12, 0.94);
  color: #f8e7c6;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.88rem;
  border: 1px solid rgba(248, 231, 198, 0.22);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  z-index: 99;
  max-width: 88vw;
  text-align: center;
  line-height: 1.45;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 心动飘散 ---------------- */
.heart-fly {
  position: fixed;
  z-index: 98;
  pointer-events: none;
  font-size: 1.1rem;
  animation: heart-fly 1.2s ease-out forwards;
  color: #e0839a;
}
@keyframes heart-fly {
  0% { opacity: 1; transform: translate(0, 0) scale(0.7); }
  100% { opacity: 0; transform: translate(var(--dx, 20px), -90px) scale(1.25); }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr 1fr; }
  .hero-favor { grid-column: 1 / -1; }
  .photo-modal { flex-direction: column; max-width: min(560px, 95vw); align-items: stretch; }
  .photo-stage { padding-top: 0; }
  .photo-stage .polaroid { max-width: 84vw; }
  .photo-side { max-height: none; }
}
@media (max-width: 680px) {
  .topbar { padding: 16px 16px 0; flex-direction: column; align-items: flex-start; gap: 10px; }
  .top-actions { width: 100%; justify-content: flex-start; }
  .hide-sm { display: none; }
  .brand-title { font-size: 1.36rem; }
  .hero { padding: 0 16px; gap: 10px; grid-template-columns: 1fr 1fr; }
  .hero-cell { padding: 13px 15px; }
  .hero-num { font-size: 2.05rem; }
  .hero-streak { display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .main { padding: 18px 16px 76px; }
  .tab { padding: 7px 13px; font-size: 0.8rem; }
  .timeline::before { display: none; }
  .tl-day { display: block; margin-bottom: 26px; }
  .tl-date { display: flex; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 8px; padding-top: 0; margin-bottom: 10px; text-align: left; }
  .tl-date::after { display: none; }
  .tl-date b { font-size: 1.05rem; }
  .tl-weekday { margin-top: 0; }
  .tl-photos, .tl-day.tl-right .tl-photos { grid-column: auto; padding: 0; grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); gap: 10px; }
  .notes-list { grid-template-columns: 1fr; }
  .login-card { padding: 30px 22px 24px; }
  .modal { padding: 14px; }
  .modal-card { padding: 22px 18px; }
  .two-col { grid-template-columns: 1fr; gap: 0; }
  .settings-links .btn { flex: 1 1 auto; justify-content: center; }
  .rope-row { margin-bottom: 34px; }
  .hangers { gap: 12px; }
  .polaroid-caption { font-size: 0.82rem; }
}

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