/* ============================================================
   恋爱小屋 · 全站样式（主页 / 登录 / 管理后台）
   ============================================================ */

:root {
  --pink: #ff5e7a;
  --pink-deep: #e84a68;
  --pink-soft: #ff8fab;
  --card: #ffffff;
  --ink: #4a2c36;
  --muted: #a08a92;
  --line: #f4dce3;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(232, 74, 104, 0.1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: linear-gradient(180deg, #fff1f5 0%, #fff7f9 40%, #fffdfd 100%);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: var(--pink-deep); text-decoration: none; }
button { font-family: inherit; }
.container { width: min(1000px, 92vw); margin: 0 auto; }

/* ---------- 浮动爱心背景 ---------- */
.hearts { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.hearts span { position: absolute; bottom: -8vh; animation: float-up linear infinite; }
@keyframes float-up {
  0%   { transform: translateY(0) rotate(-8deg) scale(0.9); }
  50%  { transform: translateY(-55vh) rotate(8deg) scale(1.05); }
  100% { transform: translateY(-112vh) rotate(-6deg) scale(0.95); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; z-index: 1;
  min-height: 96vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 72px 16px 40px;
}
.hero-eyebrow { color: var(--muted); letter-spacing: 0.35em; font-size: 0.9rem; margin-bottom: 18px; }
.hero-names {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(0.6rem, 3vw, 1.4rem);
}
.hero-names .heart { display: inline-block; animation: pulse 1.6s ease-in-out infinite; font-size: 0.75em; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.hero-since { margin-top: 12px; color: var(--muted); font-size: 0.95rem; }
.timer { margin-top: 34px; }
.timer-main { font-family: var(--serif); font-size: clamp(1.5rem, 5vw, 2.4rem); font-weight: 600; }
.timer-live {
  margin-top: 10px; color: var(--pink-deep);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1rem, 3.4vw, 1.3rem); letter-spacing: 0.06em;
}
.count-cards {
  margin-top: 44px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px; width: min(780px, 100%);
}
.count-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 12px; box-shadow: var(--shadow);
}
.count-emoji { font-size: 1.6rem; }
.count-main { margin-top: 6px; font-size: 1.15rem; font-weight: 700; color: var(--pink-deep); }
.count-label { margin-top: 2px; font-size: 0.9rem; }
.count-sub { color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.scroll-hint { margin-top: 46px; color: var(--pink-soft); font-size: 1.4rem; animation: bounce 2s infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: center; gap: 6px;
  padding: 10px 12px;
  background: rgba(255, 246, 248, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav a {
  padding: 8px 18px; border-radius: 999px;
  color: var(--ink); font-size: 0.95rem; transition: all 0.2s;
}
.nav a:hover { background: #ffe3ea; color: var(--pink-deep); }

/* ---------- 区块 ---------- */
.section { position: relative; z-index: 1; padding: 64px 0; }
.section h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  text-align: center; margin-bottom: 34px;
}
.section h2::after {
  content: ""; display: block; width: 54px; height: 3px;
  margin: 12px auto 0; border-radius: 2px;
  background: linear-gradient(90deg, var(--pink-soft), var(--pink));
}
.badge { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); margin-left: 8px; }
.empty { text-align: center; color: var(--muted); padding: 28px 0; }

/* ---------- 相册 ---------- */
.photo-grid { column-count: 3; column-gap: 14px; }
.photo {
  break-inside: avoid; margin-bottom: 14px;
  border-radius: var(--radius); overflow: hidden;
  cursor: zoom-in; box-shadow: var(--shadow); position: relative;
}
.photo img { width: 100%; transition: transform 0.35s ease; }
.photo:hover img { transform: scale(1.04); }
.photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 12px 10px; color: #fff; font-size: 0.85rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
}

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--pink-soft), #f7d4de);
}
.tl-item { position: relative; margin-bottom: 30px; }
.tl-item::before {
  content: ""; position: absolute; left: -26px; top: 8px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--card); border: 4px solid var(--pink);
  box-shadow: 0 0 0 4px #ffe3ea;
}
.tl-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tl-date {
  background: #ffe3ea; color: var(--pink-deep);
  font-size: 0.82rem; padding: 2px 12px; border-radius: 999px; font-weight: 600;
}
.tl-author { color: var(--muted); font-size: 0.82rem; }
.tl-title { margin-top: 8px; font-family: var(--serif); font-size: 1.15rem; }
.tl-content { margin-top: 6px; color: #6d4b57; white-space: pre-wrap; }
.tl-img {
  margin-top: 12px; border-radius: 12px; max-width: 320px;
  cursor: zoom-in; box-shadow: var(--shadow);
}

/* ---------- 恋爱清单 ---------- */
.progress { height: 12px; border-radius: 999px; background: #f6dfe6; overflow: hidden; }
.progress-bar {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--pink-soft), var(--pink));
  transition: width 0.6s ease;
}
.progress-text { text-align: center; color: var(--muted); margin-top: 8px; font-size: 0.88rem; }
.checklist {
  list-style: none; margin-top: 26px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.cl-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow);
}
.cl-icon { font-size: 1.15rem; color: var(--pink-soft); line-height: 1.4; }
.cl-item.done .cl-icon { color: var(--pink-deep); }
.cl-item.done .cl-title { text-decoration: line-through; color: var(--muted); }
.cl-title { font-weight: 600; }
.cl-note { color: var(--muted); font-size: 0.85rem; }
.cl-done-at { color: var(--pink-deep); font-size: 0.78rem; margin-top: 4px; }

/* ---------- 留言板 ---------- */
.msg-form {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; display: grid; gap: 12px;
  max-width: 560px; margin: 0 auto 34px;
}
input[type="text"], input[type="password"], input[type="date"], textarea {
  width: 100%; font-family: inherit; font-size: 0.95rem; color: var(--ink);
  background: #fffafb; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus { border-color: var(--pink-soft); box-shadow: 0 0 0 3px rgba(255, 143, 171, 0.18); }
textarea { resize: vertical; min-height: 90px; }
.btn {
  display: inline-block; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--pink-soft), var(--pink));
  color: #fff; font-size: 0.95rem; font-weight: 600;
  padding: 11px 26px; border-radius: 999px;
  box-shadow: 0 6px 16px rgba(255, 94, 122, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(255, 94, 122, 0.42); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.danger { background: #fff; color: #d6455f; border: 1px solid #f3c4cf; box-shadow: none; }
.btn.small { padding: 6px 14px; font-size: 0.82rem; }
.msg-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.msg {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); padding: 18px;
}
.msg-nick { font-weight: 700; color: var(--pink-deep); }
.msg-content { margin-top: 8px; font-size: 0.95rem; white-space: pre-wrap; }
.msg-time { margin-top: 10px; color: var(--muted); font-size: 0.78rem; }

/* ---------- 页脚 ---------- */
.footer {
  position: relative; z-index: 1; text-align: center;
  padding: 40px 16px 46px; color: var(--muted); font-size: 0.88rem;
  border-top: 1px solid var(--line);
}
.admin-link { display: inline-block; margin-top: 10px; color: var(--muted); font-size: 0.82rem; }
.admin-link:hover { color: var(--pink-deep); }

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(40, 14, 22, 0.94);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 10px; box-shadow: 0 12px 60px rgba(0, 0, 0, 0.5); }
.lb-caption { color: #f6dfe6; margin-top: 14px; font-size: 0.92rem; max-width: 80vw; text-align: center; }
.lb-count { color: #b98a96; font-size: 0.82rem; margin-top: 6px; }
.lb-btn {
  position: absolute; background: rgba(255, 255, 255, 0.12); color: #fff;
  border: none; border-radius: 50%; width: 46px; height: 46px;
  font-size: 1.2rem; cursor: pointer; transition: background 0.2s;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.28); }
.lb-prev { left: 4vw; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4vw; top: 50%; transform: translateY(-50%); }
.lb-close { top: 3vh; right: 3vw; }
body.no-scroll { overflow: hidden; }

/* ---------- 登录页 ---------- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.auth-card {
  width: min(400px, 94vw); background: var(--card);
  border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow); padding: 38px 30px; text-align: center;
}
.auth-heart { font-size: 2.4rem; animation: pulse 1.6s infinite; }
.auth-card h1 { font-family: var(--serif); font-size: 1.5rem; margin-top: 10px; }
.auth-sub { color: var(--muted); font-size: 0.88rem; margin: 6px 0 22px; }
.auth-card form { display: grid; gap: 14px; text-align: left; }
.auth-card label { display: grid; gap: 6px; font-size: 0.88rem; color: var(--muted); }
.auth-error { color: #d6455f; font-size: 0.85rem; min-height: 1.2em; }
.auth-back { display: inline-block; margin-top: 20px; font-size: 0.85rem; }

/* ---------- 管理后台 ---------- */
.admin-body { background: #fff8fa; }
.admin-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 14px 20px;
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.admin-top .brand { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; }
.admin-top .who { color: var(--muted); font-size: 0.85rem; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 20px 0; }
.tabs button {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font-size: 0.9rem; transition: all 0.15s;
}
.tabs button.active { background: var(--pink); border-color: var(--pink); color: #fff; }
.admin-main { width: min(920px, 94vw); margin: 18px auto 60px; }
.panel { display: none; }
.panel.active { display: block; }
.panel h2 { font-family: var(--serif); font-size: 1.35rem; margin-bottom: 16px; }
.card-form {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 22px; display: grid; gap: 12px;
}
.card-form .form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.card-form label { display: grid; gap: 6px; font-size: 0.85rem; color: var(--muted); }
.dropzone {
  border: 2px dashed var(--pink-soft); border-radius: 14px;
  background: #fffafb; padding: 30px 16px; text-align: center;
  color: var(--muted); cursor: pointer; transition: all 0.2s;
}
.dropzone.drag { border-color: var(--pink); background: #ffeef2; color: var(--pink-deep); }
.upload-status { font-size: 0.85rem; color: var(--muted); min-height: 1.4em; }
.photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.photo-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow);
}
.photo-card img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.photo-card-body { padding: 10px 12px; display: grid; gap: 8px; }
.row {
  display: flex; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 16px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.row-done { opacity: 0.65; }
.row-info { flex: 1; min-width: 0; }
.row-title { font-weight: 600; }
.row-sub { color: var(--muted); font-size: 0.85rem; margin-top: 2px; white-space: pre-wrap; }
.row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--pink); flex-shrink: 0; }
.summary { color: var(--muted); font-size: 0.88rem; margin-bottom: 10px; }
.toast {
  position: fixed; left: 50%; bottom: 30px;
  transform: translate(-50%, 20px);
  background: #3a2028; color: #fff;
  padding: 10px 22px; border-radius: 999px; font-size: 0.9rem;
  opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #c0392b; }
.hint { color: var(--muted); font-size: 0.82rem; }
.divider { border: none; border-top: 1px dashed var(--line); margin: 22px 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 820px) {
  .count-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-grid { column-count: 2; }
  .checklist { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .count-cards { gap: 10px; }
  .photo-grid { column-count: 2; column-gap: 8px; }
  .photo { margin-bottom: 8px; }
  .nav a { padding: 6px 12px; font-size: 0.88rem; }
  .hero { min-height: 92vh; }
  .msg-wall { grid-template-columns: 1fr 1fr; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .hearts { display: none; }
  * { animation: none !important; }
}
