/* ========== 基础 ========== */
:root {
  --bg: #fdf6f0;
  --bg-alt: #f9e9e3;
  --card: #ffffff;
  --ink: #5b4040;
  --ink-soft: #9a7b7b;
  --rose: #e0637f;
  --rose-deep: #c74e6d;
  --rose-soft: #f9d9e0;
  --gold: #d9a441;
  --shadow: 0 10px 30px rgba(190, 80, 105, 0.12);
  --radius: 18px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea {
  font: inherit; width: 100%; padding: 10px 14px;
  border: 1.5px solid #f0d8dd; border-radius: 12px;
  background: #fff; color: var(--ink); outline: none;
  transition: border-color 0.2s;
}
input:focus, textarea:focus { border-color: var(--rose); }
textarea { resize: vertical; }
.hidden { display: none !important; }
.center { text-align: center; }

/* ========== 漂浮爱心 ========== */
.hearts-layer { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.heart {
  position: absolute; bottom: -50px;
  color: rgba(224, 99, 127, 0.16);
  animation: floatUp linear infinite;
  user-select: none;
}
@keyframes floatUp {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.35; }
  100% { transform: translateY(-110vh) rotate(25deg); opacity: 0; }
}

/* ========== 导航 ========== */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px;
  background: rgba(253, 246, 240, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #f3ddd8;
}
.nav-logo { font-weight: 700; font-size: 16px; letter-spacing: 0.5px; }
.nav-links { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.nav-links a { color: var(--ink-soft); transition: color 0.2s; }
.nav-links a:hover { color: var(--rose); }

/* ========== 按钮 ========== */
.btn-ghost {
  padding: 8px 16px; border-radius: 999px;
  border: 1.5px solid var(--rose); color: var(--rose);
  font-size: 14px; transition: all 0.2s;
}
.btn-ghost:hover { background: var(--rose); color: #fff; }
.btn-small { padding: 6px 13px; font-size: 13px; }
.btn-primary {
  padding: 10px 22px; border-radius: 999px;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  color: #fff; font-size: 15px; font-weight: 600;
  box-shadow: 0 6px 16px rgba(224, 99, 127, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(224, 99, 127, 0.45); }
.btn-danger {
  padding: 5px 12px; border-radius: 999px;
  background: #fbe3e3; color: #d9534f; font-size: 12px;
  transition: background 0.2s;
}
.btn-danger:hover { background: #d9534f; color: #fff; }

/* ========== Hero ========== */
.hero {
  position: relative; z-index: 1;
  text-align: center;
  padding: 84px 20px 60px;
  background: linear-gradient(165deg, #fdeef2 0%, #fdf6f0 48%, #fbeae4 100%);
}
.hero-badge {
  display: inline-block; font-size: 12px; letter-spacing: 3px;
  color: var(--rose-deep); background: var(--rose-soft);
  padding: 6px 16px; border-radius: 999px; margin-bottom: 18px;
}
.hero-title {
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(120deg, var(--rose-deep), var(--gold));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}
.hero-text { color: var(--ink-soft); font-size: 16px; margin-bottom: 30px; }
.hero-stats { display: flex; align-items: center; justify-content: center; gap: 26px; margin-bottom: 14px; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num {
  font-size: clamp(28px, 5vw, 42px); font-weight: 800; color: var(--rose-deep);
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.stat-heart { font-size: 26px; color: var(--rose); animation: beat 1.2s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.hero-dates { color: var(--ink-soft); font-size: 14px; margin-bottom: 28px; }
.btn-heart {
  display: inline-block; padding: 12px 28px; border-radius: 999px;
  background: #fff; color: var(--rose-deep); font-weight: 600;
  box-shadow: var(--shadow); border: 1.5px solid var(--rose-soft);
  transition: all 0.2s;
}
.btn-heart:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(190, 80, 105, 0.2); }

/* ========== 通用区块 ========== */
.section { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; padding: 70px 20px; }
.section-alt { max-width: none; background: var(--bg-alt); padding-left: 24px; padding-right: 24px; }
.section-title { text-align: center; font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.section-sub { text-align: center; color: var(--ink-soft); font-size: 14px; margin-bottom: 42px; }
.empty { text-align: center; color: var(--ink-soft); padding: 40px 0; font-size: 14px; }

/* ========== 时光轴 ========== */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: ""; position: absolute; left: 12px; top: 4px; bottom: 4px;
  width: 2px; background: linear-gradient(var(--rose-soft), var(--rose), var(--rose-soft));
  border-radius: 2px;
}
.timeline-item { position: relative; margin-bottom: 28px; }
.timeline-dot {
  position: absolute; left: -30px; top: 6px; width: 26px; height: 26px;
  background: #fff; border: 2px solid var(--rose); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--rose); font-size: 12px; box-shadow: 0 2px 8px rgba(224, 99, 127, 0.25);
}
.timeline-card {
  background: var(--card); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
  border: 1px solid #f7e3de;
}
.tl-date {
  display: inline-block; font-size: 12px; color: var(--rose-deep);
  background: var(--rose-soft); padding: 3px 12px; border-radius: 999px;
  margin-bottom: 8px; font-weight: 600;
}
.timeline-card h3 { font-size: 18px; margin-bottom: 6px; }
.timeline-card p { color: var(--ink-soft); font-size: 14px; white-space: pre-wrap; }
.tl-photo {
  margin-top: 12px; border-radius: 12px; max-height: 320px;
  width: 100%; object-fit: cover; cursor: zoom-in;
}

/* ========== 照片墙 ========== */
.gallery { columns: 3; column-gap: 14px; max-width: 1200px; margin: 0 auto; }
.gallery-item {
  break-inside: avoid; margin-bottom: 14px; position: relative;
  border-radius: 14px; overflow: hidden; cursor: zoom-in;
  box-shadow: 0 4px 14px rgba(190, 80, 105, 0.1);
  transition: transform 0.25s;
}
.gallery-item:hover { transform: translateY(-3px); }
.gallery-item img { width: 100%; transition: transform 0.35s; }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 12px 10px; font-size: 13px; color: #fff;
  background: linear-gradient(transparent, rgba(91, 64, 64, 0.65));
  opacity: 0; transition: opacity 0.25s;
}
.gallery-item:hover figcaption { opacity: 1; }
.g-photo-date { display: block; font-size: 12px; opacity: 0.85; }

/* ========== 小情话 ========== */
.quote-card {
  display: block; width: 100%; max-width: 640px; margin: 0 auto;
  background: var(--card); border: 1.5px solid var(--rose-soft);
  border-radius: var(--radius); padding: 30px 26px;
  font-size: 17px; color: var(--ink);
  box-shadow: var(--shadow); transition: transform 0.2s;
}
.quote-card:hover { transform: scale(1.01); }

/* ========== 页脚 ========== */
.footer { position: relative; z-index: 1; text-align: center; padding: 34px 16px 40px; color: var(--ink-soft); font-size: 13px; }

/* ========== 弹窗 ========== */
.modal {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(91, 64, 64, 0.45); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  width: 100%; max-width: 380px; background: #fff;
  border-radius: 22px; padding: 30px 26px;
  box-shadow: 0 24px 60px rgba(91, 64, 64, 0.3);
  text-align: center;
}
.modal-card h3 { font-size: 19px; margin-bottom: 10px; }
.modal-sub { color: var(--ink-soft); font-size: 13px; margin-bottom: 18px; }
.modal-card input { margin-bottom: 14px; text-align: center; }
.modal-card .btn-primary { width: 100%; }
.modal-err { color: #d9534f; font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ========== 灯箱 ========== */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30, 18, 18, 0.92);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; padding: 20px;
}
.lightbox img {
  max-width: 92vw; max-height: 82vh; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-caption { color: #eee; margin-top: 14px; font-size: 14px; text-align: center; max-width: 80vw; }
.lightbox-close {
  position: absolute; top: 14px; right: 20px;
  font-size: 34px; color: #fff; opacity: 0.85; line-height: 1;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 44px; color: #fff; opacity: 0.6; padding: 8px 14px;
}
.lightbox-nav:hover { opacity: 1; }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

/* ========== 管理后台 ========== */
.admin-panel {
  position: fixed; inset: 0; z-index: 80;
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.admin-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; background: #fff;
  border-bottom: 1px solid #f0d8dd;
}
.admin-head h3 { font-size: 18px; }
.admin-tabs {
  display: flex; gap: 8px; padding: 12px 16px;
  background: #fff; border-bottom: 1px solid #f0d8dd;
  overflow-x: auto;
}
.admin-tab {
  flex: 0 0 auto; padding: 8px 16px; border-radius: 999px;
  font-size: 14px; color: var(--ink-soft);
  border: 1.5px solid transparent;
}
.admin-tab.active {
  color: var(--rose-deep); background: var(--rose-soft); font-weight: 600;
}
.admin-body { max-width: 760px; width: 100%; margin: 0 auto; padding: 26px 20px 60px; }
.admin-tabpage { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field-row { display: flex; gap: 14px; }
.field.grow { flex: 1; }
.dropzone {
  border: 2px dashed var(--rose); border-radius: var(--radius);
  background: #fff; padding: 34px 16px; text-align: center;
  cursor: pointer; transition: all 0.2s;
}
.dropzone.dragover { background: var(--rose-soft); border-color: var(--rose-deep); }
.dz-icon { font-size: 34px; margin-bottom: 8px; }
.dz-sub { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.progress-text { color: var(--rose-deep); font-size: 14px; min-height: 20px; }
.manage-title { font-size: 15px; margin: 18px 0 10px; color: var(--ink-soft); }
.manage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.manage-item {
  background: #fff; border-radius: 14px; overflow: hidden;
  border: 1px solid #f0d8dd; box-shadow: 0 3px 10px rgba(190, 80, 105, 0.08);
}
.manage-item img { width: 100%; height: 100px; object-fit: cover; }
.manage-item-info { padding: 10px 12px; }
.mi-caption { font-size: 13px; font-weight: 600; }
.mi-date { font-size: 12px; color: var(--ink-soft); margin: 2px 0 8px; }
.manage-list { display: flex; flex-direction: column; gap: 10px; }

/* ========== Toast ========== */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 120; background: rgba(91, 64, 64, 0.92); color: #fff;
  padding: 10px 22px; border-radius: 999px; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: toastIn 0.25s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .gallery { columns: 2; }
  .field-row { flex-direction: column; }
  .hero { padding: 64px 16px 46px; }
  .nav-links a { display: none; }
}