/* =====================================================
   我们的恋爱小站 · 全局样式
   浪漫粉紫渐变主题
   ===================================================== */

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

:root {
  --pink:        #ff7eb6;
  --pink-soft:   #ffd9e9;
  --purple:      #9b7bd4;
  --purple-deep: #7a5fc9;
  --text:        #4d3b58;
  --muted:       #9587a0;
  --card:        rgba(255, 255, 255, 0.72);
  --radius:      20px;
  --shadow:      0 10px 34px rgba(180, 120, 200, 0.16);
}

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  background: linear-gradient(160deg, #ffe4f1 0%, #f2e7ff 48%, #ffe4f1 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 126, 182, 0.15);
}
.nav-inner {
  max-width: 1000px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; gap: 12px;
}
.logo { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; color: var(--purple-deep); }
.logo .heart { color: var(--pink); animation: beat 1.6s ease-in-out infinite; }
.nav-links { display: flex; gap: 6px; list-style: none; }
.nav-links a { display: block; padding: 8px 14px; border-radius: 999px; font-size: 15px; transition: 0.25s; }
.nav-links a:hover { background: var(--pink-soft); color: var(--pink); }
.nav-links a.active {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff; box-shadow: 0 6px 16px rgba(255, 126, 182, 0.35);
}
.nav-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--purple-deep); }

/* hidden 与 flex 共存时的显隐 */
.form-row[hidden], #meeting-form[hidden] { display: none !important; }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; display: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    padding: 10px 16px 16px; gap: 4px;
    border-bottom: 1px solid rgba(255, 126, 182, 0.2);
    box-shadow: 0 20px 30px rgba(180, 120, 200, 0.15);
  }
  .nav-links.open { display: flex; }
  .nav-links a { text-align: center; }
}

/* ---------- 主体 ---------- */
main { position: relative; z-index: 1; max-width: 1000px; margin: 0 auto; padding: 40px 20px 60px; }

/* ---------- 首页 Hero ---------- */
.hero { text-align: center; padding: 26px 0 6px; }
.hero-hello { color: var(--muted); letter-spacing: 0.3em; font-size: 14px; }
.hero h1 {
  font-size: clamp(30px, 6vw, 48px); margin: 12px 0 6px;
  background: linear-gradient(120deg, var(--pink) 10%, var(--purple) 60%, var(--pink) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 5s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }
.couple-names {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  font-size: clamp(20px, 4.5vw, 30px); font-weight: 700; margin: 14px 0 4px; flex-wrap: wrap;
}
.heart-beat { color: var(--pink); font-size: 1.4em; display: inline-block; animation: beat 1.2s ease-in-out infinite; }
@keyframes beat {
  0%, 100% { transform: scale(1); }
  30%      { transform: scale(1.25); }
  50%      { transform: scale(1); }
  70%      { transform: scale(1.2); }
}
.hero-sub { color: var(--muted); }
.hero-hearts { font-size: 20px; letter-spacing: 10px; color: var(--pink); margin-top: 18px; opacity: 0.85; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- 数据卡片 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin: 38px 0; }
.stat-card { padding: 24px 16px; text-align: center; }
.stat-icon { font-size: 26px; }
.stat-num { font-size: clamp(20px, 4vw, 28px); font-weight: 800; margin: 8px 0 2px; color: var(--purple-deep); }
.stat-num small { font-size: 15px; font-weight: 600; color: var(--muted); }
.stat-label { color: var(--muted); font-size: 13px; letter-spacing: 0.12em; }

/* ---------- 倒计时 ---------- */
.countdown { padding: 28px 20px; text-align: center; margin-bottom: 8px; }
.countdown h2 { font-size: 20px; color: var(--purple-deep); }
.countdown-sub { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* ---------- 见面日期设置 ---------- */
.meeting-set { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.meeting-btn {
  border: 1.5px dashed rgba(155, 123, 212, 0.5); background: rgba(255, 255, 255, 0.6);
  color: var(--purple-deep); border-radius: 999px; padding: 8px 20px; font-size: 14px;
  cursor: pointer; font-family: inherit; transition: 0.25s;
}
.meeting-btn:hover { border-color: var(--pink); color: var(--pink); }
#meeting-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
#meeting-form input[type="date"] {
  padding: 8px 12px; border-radius: 12px; border: 1.5px solid rgba(155, 123, 212, 0.35);
  background: rgba(255, 255, 255, 0.85); font-family: inherit; color: var(--text); font-size: 14px;
}
.meeting-save {
  border: none; background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff;
  border-radius: 12px; padding: 8px 18px; cursor: pointer; font-family: inherit; font-size: 14px;
}
.meeting-cancel {
  border: 1.5px solid rgba(155, 123, 212, 0.35); background: transparent; color: var(--muted);
  border-radius: 12px; padding: 8px 14px; cursor: pointer; font-family: inherit; font-size: 14px;
}
.countdown-time { display: flex; justify-content: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.count-unit {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff; border-radius: 16px; min-width: 74px; padding: 12px 8px;
  box-shadow: 0 8px 18px rgba(255, 126, 182, 0.3);
}
.count-unit b { display: block; font-size: 26px; }
.count-unit span { font-size: 12px; opacity: 0.9; }

/* ---------- 通用段落 ---------- */
.section { margin: 48px 0; }
.section-title {
  text-align: center; font-size: 24px; color: var(--purple-deep);
  margin-bottom: 20px; display: flex; align-items: center; justify-content: center; gap: 12px;
}
.section-title::before, .section-title::after { content: ""; height: 2px; width: 48px; background: linear-gradient(90deg, transparent, var(--pink)); }
.section-title::after { background: linear-gradient(90deg, var(--pink), transparent); }
.about-card { padding: 28px 26px; max-width: 640px; margin: 0 auto; text-align: center; }
.about-card p + p { margin-top: 12px; }
.todo { color: var(--pink); background: var(--pink-soft); border-radius: 8px; padding: 2px 10px; font-size: 13px; white-space: nowrap; }

/* ---------- 快速入口 ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.quick-card { display: block; padding: 26px 18px; text-align: center; transition: 0.3s; }
.quick-card:hover { transform: translateY(-6px); box-shadow: 0 16px 36px rgba(180, 120, 200, 0.28); }
.quick-card .icon { font-size: 34px; }
.quick-card h3 { margin: 10px 0 4px; color: var(--purple-deep); }
.quick-card p { color: var(--muted); font-size: 14px; }

/* ---------- 子页面头部 ---------- */
.page-head { text-align: center; padding: 24px 0 6px; }
.page-head h1 {
  font-size: clamp(26px, 5vw, 38px);
  background: linear-gradient(120deg, var(--pink), var(--purple));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-head p { color: var(--muted); margin-top: 8px; }

/* ---------- 时间线（我们的故事） ---------- */
.timeline { max-width: 640px; margin: 36px auto 0; position: relative; padding-left: 36px; }
.timeline::before {
  content: ""; position: absolute; left: 12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px;
  background: linear-gradient(var(--pink), var(--purple));
}
.tl-item { position: relative; margin-bottom: 28px; }
.tl-dot {
  position: absolute; left: -36px; top: 4px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 4px solid var(--pink); box-shadow: 0 0 0 5px rgba(255, 126, 182, 0.2);
}
.tl-date {
  display: inline-block; color: #fff; font-size: 13px; padding: 4px 14px; border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 6px 14px rgba(255, 126, 182, 0.3); margin-bottom: 10px;
}
.tl-card { padding: 20px 22px; }
.tl-card h3 { margin-bottom: 6px; color: var(--purple-deep); font-size: 18px; }
.tl-card p { color: var(--muted); font-size: 15px; }
.tl-card .todo { font-size: 12px; }

/* ---------- 相册 ---------- */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-top: 36px; }
.album-slot {
  aspect-ratio: 1; border: 2px dashed rgba(155, 123, 212, 0.4); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--muted); background: rgba(255, 255, 255, 0.4); transition: 0.3s;
}
.album-slot .icon { font-size: 30px; }
.album-slot small { font-size: 12px; }
.album-slot:hover { border-color: var(--pink); color: var(--pink); transform: scale(1.02); }
.album-tip { max-width: 560px; margin: 26px auto 0; padding: 18px 22px; text-align: center; font-size: 14px; color: var(--muted); }

/* ---------- 悄悄话 ---------- */
.words-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; max-width: 860px; margin: 36px auto 0; }
.word-card { padding: 28px 22px; position: relative; }
.word-card::before {
  content: "“"; position: absolute; top: 2px; left: 14px; font-size: 52px;
  color: var(--pink); opacity: 0.35; font-family: Georgia, serif;
}
.word-card p { font-size: 16px; padding-left: 16px; padding-top: 10px; }
.word-badge {
  position: absolute; top: 14px; right: 16px; font-size: 11px; color: var(--muted);
  border: 1px solid var(--pink-soft); padding: 2px 10px; border-radius: 999px; background: rgba(255,255,255,0.6);
}
.word-card.placeholder {
  display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted);
  border: 2px dashed rgba(155, 123, 212, 0.35); background: rgba(255, 255, 255, 0.35); box-shadow: none;
}

/* ---------- 心愿清单 ---------- */
.wish-list { max-width: 640px; margin: 36px auto 0; display: flex; flex-direction: column; gap: 14px; }
.wish-item { display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; transition: 0.25s; }
.wish-item:hover { transform: translateX(4px); }
.wish-item input { display: none; }
.wish-check { font-size: 24px; color: #dccde4; transition: 0.25s; }
.wish-item input:checked ~ .wish-check { color: var(--pink); }
.wish-text { flex: 1; font-size: 16px; transition: 0.25s; }
.wish-item input:checked ~ .wish-text { text-decoration: line-through; color: var(--muted); }
.wish-note { max-width: 640px; margin: 26px auto 0; padding: 16px 22px; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- 页脚 ---------- */
.footer { position: relative; z-index: 1; text-align: center; padding: 30px 20px 44px; color: var(--muted); font-size: 14px; }
.footer .heart { color: var(--pink); display: inline-block; animation: beat 1.6s ease-in-out infinite; }

/* ---------- 漂浮爱心 ---------- */
.heart-float {
  position: fixed; bottom: -70px; z-index: 0; pointer-events: none; user-select: none;
  animation: floatUp linear forwards;
}
@keyframes floatUp {
  to { transform: translateY(-115vh) rotate(24deg); opacity: 0; }
}

/* ---------- 上传表单 ---------- */
.upload-card { max-width: 640px; margin: 0 auto 34px; padding: 24px 22px; }
.upload-title { color: var(--purple-deep); font-size: 17px; margin-bottom: 14px; }
.upload-card form { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-row.two > * { flex: 1 1 150px; }
.form-row input[type="text"],
.form-row input[type="password"],
.form-row textarea {
  flex: 1; min-width: 150px; padding: 10px 14px; border-radius: 14px;
  border: 1.5px solid rgba(155, 123, 212, 0.3); background: rgba(255, 255, 255, 0.8);
  font-size: 15px; color: var(--text); outline: none; font-family: inherit; resize: vertical;
  transition: border-color 0.25s;
}
.form-row input:focus, .form-row textarea:focus { border-color: var(--pink); }
.file-label {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px;
  border-radius: 14px; background: var(--pink-soft); color: var(--purple-deep);
  font-size: 14px; cursor: pointer; white-space: nowrap; transition: 0.25s;
}
.file-label:hover { background: #ffc6df; }
.file-label input { display: none; }
.upload-btn {
  align-self: center; border: none; cursor: pointer; color: #fff; font-size: 16px;
  padding: 11px 34px; border-radius: 999px; font-family: inherit;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 8px 18px rgba(255, 126, 182, 0.35); transition: 0.25s;
}
.upload-btn:hover { transform: translateY(-2px); }
.upload-btn:disabled { opacity: 0.6; cursor: wait; }
.pw-hint { font-size: 12px; color: var(--muted); white-space: nowrap; }
.form-flash { font-size: 14px; text-align: center; min-height: 20px; }
.upload-tip { text-align: center; font-size: 12px; color: var(--muted); margin-top: 12px; }
.photo-name { font-size: 12px; color: var(--purple-deep); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.photo-preview { margin-top: 10px; text-align: center; }
.photo-preview img { max-width: 100%; max-height: 220px; border-radius: 14px; box-shadow: var(--shadow); }
.empty-tip { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 20px; font-size: 15px; }
.load-state { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 20px; font-size: 15px; line-height: 2; }
.retry-btn {
  border: 1.5px solid var(--pink); background: #fff; color: var(--pink);
  border-radius: 999px; padding: 8px 22px; font-size: 14px; cursor: pointer;
  font-family: inherit; transition: 0.25s; margin-top: 6px;
}
.retry-btn:hover { background: var(--pink-soft); }

/* ---------- 相册照片 ---------- */
.album-photo {
  position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); background: #fff;
}
.album-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 14px 10px;
  font-size: 13px; color: #fff; text-align: center;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
}
.album-photo:hover img { transform: scale(1.04); transition: transform 0.4s; }

/* ---------- 删除按钮 ---------- */
.del-btn {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
  border: none; border-radius: 50%; background: rgba(0, 0, 0, 0.45); color: #fff;
  font-size: 12px; cursor: pointer; opacity: 0; transition: 0.25s; line-height: 1;
}
.album-photo:hover .del-btn, .word-card:hover .del-btn, .tl-card:hover .del-btn, .wish-item:hover .del-btn { opacity: 1; }
.del-btn:hover { background: #e05b7b; }
.del-btn.small { position: static; flex: none; width: 24px; height: 24px; opacity: 0.7; }

/* 心愿删除按钮在小屏上保持可见 */
@media (max-width: 560px) {
  .del-btn { opacity: 0.8; }
}

/* ---------- 身份选择与位置提示 ---------- */
.pos-hint { margin-top: 10px; font-size: 12px; color: var(--muted); min-height: 18px; }

/* ---------- 入口密码门 ---------- */
.entry-gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(160deg, #ffe4f1 0%, #f2e7ff 48%, #ffe4f1 100%);
}
.entry-gate[hidden] { display: none !important; }
body.gated { overflow: hidden; }
.gate-card {
  width: 100%; max-width: 360px; text-align: center;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px; padding: 38px 28px 30px;
  box-shadow: 0 20px 50px rgba(180, 120, 200, 0.25);
}
.gate-heart { font-size: 44px; animation: beat 1.4s ease-in-out infinite; }
.gate-card h2 { margin: 12px 0 4px; color: var(--purple-deep); letter-spacing: 0.08em; }
.gate-card p { color: var(--muted); font-size: 14px; }
#gate-form { display: flex; gap: 8px; margin-top: 20px; }
#gate-form input {
  flex: 1; min-width: 0; padding: 11px 14px; border-radius: 14px;
  border: 1.5px solid rgba(155, 123, 212, 0.35); background: #fff;
  font-size: 15px; font-family: inherit; color: var(--text); outline: none;
}
#gate-form input:focus { border-color: var(--pink); }
#gate-form button {
  border: none; cursor: pointer; color: #fff; padding: 11px 20px; border-radius: 14px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  font-family: inherit; font-size: 15px;
}
.gate-error { min-height: 20px; margin-top: 12px; color: #d64545; font-size: 13px; }
.switch-id { font-size: 12px; color: var(--muted); text-decoration: underline; opacity: 0.7; }
.switch-id:hover { color: var(--pink); }

/* ---------- 小屏适配 ---------- */
@media (max-width: 560px) {
  main { padding: 28px 16px 48px; }
  .countdown-time { gap: 8px; }
  .count-unit { min-width: 60px; }
}

/* ---------- 版本号 ---------- */
.site-version { font-size: 11px; color: var(--muted); opacity: 0.6; }
