/* ============================================================
   恋爱小屋 - 温馨暖色 + 粉色 + 呆萌卡通 主题样式
   ============================================================ */

:root {
  --pink: #ff6b9d;
  --pink-light: #ff9ebb;
  --pink-soft: #ffd1e0;
  --peach: #ffb5a7;
  --cream: #fff6f0;
  --cream-deep: #ffeadb;
  --coral: #f4978e;
  --rose: #e85d8a;
  --text: #6d4a5a;
  --text-light: #a5858f;
  --card-bg: #ffffff;
  --shadow: 0 10px 30px rgba(255, 130, 165, 0.15);
  --shadow-sm: 0 4px 14px rgba(255, 130, 165, 0.12);
  --radius: 22px;
  --radius-sm: 14px;
  --grad: linear-gradient(135deg, #ffb5a7 0%, #ff9ebb 45%, #ff6b9d 100%);
  --grad-soft: linear-gradient(135deg, #fff6f0 0%, #ffeadb 50%, #ffd1e0 100%);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--grad-soft);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============ 背景漂浮装饰 ============ */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-decor span {
  position: absolute;
  font-size: 2.2rem;
  opacity: 0.5;
  animation: floaty 8s ease-in-out infinite;
}
.cloud-1 { top: 12%; left: 6%; animation-delay: 0s; }
.cloud-2 { top: 22%; right: 10%; animation-delay: 2.5s; font-size: 3rem; }
.cloud-3 { top: 60%; left: 12%; animation-delay: 5s; font-size: 1.8rem; }
.heart-1 { bottom: 18%; left: 20%; animation-delay: 1s; }
.heart-2 { top: 8%; left: 45%; animation-delay: 3s; font-size: 1.6rem; }
.heart-3 { bottom: 30%; right: 22%; animation-delay: 4.5s; font-size: 1.8rem; }
.star-1 { top: 40%; right: 5%; animation-delay: 1.8s; }
.star-2 { bottom: 12%; right: 8%; animation-delay: 3.8s; font-size: 1.5rem; }
.star-3 { top: 70%; left: 5%; animation-delay: 6s; font-size: 1.4rem; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(6deg); }
}

/* ============ 导航栏 ============ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 20px 10px;
}
.navbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 10px 18px;
  box-shadow: var(--shadow-sm);
}
.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--rose);
}
.brand-icon { font-size: 1.4rem; transition: transform 0.3s; }
.brand:hover .brand-icon { transform: scale(1.2) rotate(-8deg); }

.nav-links { display: flex; list-style: none; gap: 6px; }
.nav-link {
  text-decoration: none;
  color: var(--text-light);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  transition: all 0.25s;
  font-size: 0.98rem;
}
.nav-link:hover { color: var(--rose); background: #fff0f5; }
.nav-link.active {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 6px 16px rgba(255, 107, 157, 0.35);
}

.settings-btn {
  background: #fff;
  border: 1px solid #ffe0ea;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.25s;
  color: var(--text-light);
}
.settings-btn:hover { transform: rotate(60deg); background: #fff0f5; color: var(--rose); }

/* ============ 主容器 ============ */
.container {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.page { display: none; animation: fadeUp 0.4s ease; }
.page.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ 首页 Hero ============ */
.hero {
  text-align: center;
  padding: 30px 20px 40px;
}
.hero-mascots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 10px;
}
.mascot { font-size: 3.4rem; animation: bounce 2.6s ease-in-out infinite; }
.mascot-right { animation-delay: 0.4s; }
.hero-heart { font-size: 2.2rem; animation: heartbeat 1.6s ease-in-out infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.15); }
  40% { transform: scale(0.95); }
  60% { transform: scale(1.1); }
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin: 6px 0;
}
.hero-title .highlight {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle { color: var(--text-light); font-size: 1.05rem; }

/* 恋爱天数卡片 */
.days-card {
  margin: 28px auto 0;
  max-width: 420px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.days-card::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  background: var(--pink-soft);
  border-radius: 50%;
  opacity: 0.5;
}
.days-card::after {
  content: "";
  position: absolute;
  bottom: -30px; left: -30px;
  width: 90px; height: 90px;
  background: var(--cream-deep);
  border-radius: 50%;
  opacity: 0.6;
}
.days-card-header { font-size: 1rem; color: var(--text-light); }
.days-number {
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1.1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 2px;
}
.days-label { color: var(--rose); font-weight: 700; }
.days-since { margin-top: 8px; color: var(--text-light); font-size: 0.9rem; }

/* 快捷入口 */
.quick-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}
.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--card-bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px 26px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s;
  font-family: inherit;
  color: var(--text);
}
.quick-btn:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.quick-icon { font-size: 1.8rem; }
.quick-text { font-weight: 600; }

/* ============ 通用区块 ============ */
.section-block { margin-top: 34px; }
.section-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.count-badge {
  background: var(--grad);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
}
.count-badge.wish { background: linear-gradient(135deg, #ffb5a7, #f4978e); }

/* 统计卡片 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 20px 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stat-card:hover { transform: translateY(-4px); }
.stat-emoji { font-size: 1.8rem; }
.stat-number { font-size: 1.7rem; font-weight: 800; color: var(--rose); }
.stat-label { color: var(--text-light); font-size: 0.9rem; }

/* ============ 页面头 ============ */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.page-title { font-size: 1.9rem; font-weight: 800; }
.page-desc { color: var(--text-light); }

/* ============ 按钮 ============ */
.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 107, 157, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(255, 107, 157, 0.45); }
.btn-ghost { background: #f3e4ea; color: var(--text); }
.btn-ghost:hover { background: #ecd5de; }
.btn-danger { background: #ff6b6b; color: #fff; }
.btn-danger:hover { background: #f55252; }

/* ============ 足迹卡片 ============ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.place-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.place-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.place-emoji { font-size: 2.6rem; }
.place-name { font-size: 1.15rem; font-weight: 800; }
.place-meta { color: var(--text-light); font-size: 0.85rem; display: flex; align-items: center; gap: 6px; }
.place-note { color: var(--text); font-size: 0.92rem; flex: 1; }
.place-tag {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
}
.place-tag.visited { background: #ffe3ee; color: var(--rose); }
.place-tag.wishlist { background: #ffefe0; color: #e0835a; }
.place-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.place-actions button {
  border: none;
  background: #f8ecef;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-light);
  transition: all 0.2s;
}
.place-actions button:hover { background: #ffdde8; color: var(--rose); }
.place-actions .del:hover { background: #ffe0e0; color: #f55252; }

.empty-hint {
  text-align: center;
  color: var(--text-light);
  padding: 30px 10px;
  background: rgba(255,255,255,0.5);
  border-radius: var(--radius-sm);
  border: 2px dashed #ffd9e6;
}

/* ============ 日记 ============ */
.diary-list { display: flex; flex-direction: column; gap: 16px; }
.diary-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all 0.25s;
}
.diary-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.diary-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.diary-mood { font-size: 1.8rem; }
.diary-date {
  color: var(--rose);
  font-weight: 700;
  font-size: 0.9rem;
  background: #ffeef4;
  padding: 3px 12px;
  border-radius: 999px;
}
.diary-title { font-size: 1.2rem; font-weight: 800; margin-top: 8px; }
.diary-content {
  color: var(--text);
  margin-top: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}
.diary-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.diary-actions button {
  border: none;
  background: #f8ecef;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-light);
  transition: all 0.2s;
}
.diary-actions button:hover { background: #ffdde8; color: var(--rose); }
.diary-actions .del:hover { background: #ffe0e0; color: #f55252; }

/* ============ 弹窗 ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(120, 60, 80, 0.35);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(120, 60, 80, 0.3);
  animation: pop 0.3s ease;
}
.modal-small { max-width: 400px; }
@keyframes pop {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 8px;
}
.modal-header h3 { font-size: 1.25rem; font-weight: 800; }
.modal-close {
  border: none;
  background: #f8ecef;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-light);
  transition: all 0.2s;
}
.modal-close:hover { background: #ffdde8; color: var(--rose); transform: rotate(90deg); }
.modal-body { padding: 10px 22px 16px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 6px 22px 22px;
}

.field { display: block; margin-bottom: 16px; }
.field-label { display: block; font-weight: 700; font-size: 0.92rem; margin-bottom: 6px; color: var(--text); }
.field input[type="text"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%;
  border: 2px solid #ffe0ea;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: #fffafc;
  transition: border 0.2s, box-shadow 0.2s;
  outline: none;
  resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--pink-light);
  box-shadow: 0 0 0 4px rgba(255, 155, 187, 0.15);
  background: #fff;
}
.field-hint { font-size: 0.85rem; color: var(--text-light); margin-top: -6px; }
.confirm-text { color: var(--text); font-size: 1rem; }

/* 分段选择 */
.segmented {
  display: flex;
  gap: 6px;
  background: #fff0f5;
  padding: 4px;
  border-radius: 12px;
}
.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  color: var(--text-light);
  transition: all 0.2s;
}
.seg-btn.active { background: #fff; color: var(--rose); box-shadow: 0 2px 8px rgba(255, 130, 165, 0.2); }

/* emoji 选择器 */
.emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-btn {
  border: 2px solid transparent;
  background: #fffafc;
  font-size: 1.5rem;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.emoji-btn:hover { transform: scale(1.1); background: #fff0f5; }
.emoji-btn.active { border-color: var(--pink); background: #ffeef4; }

/* 心情选择器 */
.mood-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.mood-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 2px solid transparent;
  background: #fffafc;
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.5rem;
  transition: all 0.2s;
}
.mood-btn span { font-size: 0.75rem; color: var(--text-light); font-weight: 600; }
.mood-btn:hover { transform: scale(1.06); background: #fff0f5; }
.mood-btn.active { border-color: var(--pink); background: #ffeef4; }

/* ============ 登录遮罩 ============ */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--grad-soft);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-overlay.open { display: flex; }
.login-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 36px 28px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(120, 60, 80, 0.25);
  animation: pop 0.35s ease;
}
.login-mascots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 2.6rem;
  margin-bottom: 8px;
}
.login-mascots .mascot { animation: bounce 2.6s ease-in-out infinite; }
.login-heart { animation: heartbeat 1.6s ease-in-out infinite; font-size: 1.8rem; }
.login-title { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.login-sub { color: var(--text-light); font-size: 0.95rem; margin: 6px 0 18px; }
.login-loading {
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 0;
}
.spinner {
  width: 18px; height: 18px;
  border: 3px solid #ffd1e0;
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form input[type="password"] {
  width: 100%;
  border: 2px solid #ffe0ea;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fffafc;
  text-align: center;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}
.login-form input[type="password"]:focus {
  border-color: var(--pink-light);
  box-shadow: 0 0 0 4px rgba(255, 155, 187, 0.15);
}
.login-form .btn { width: 100%; }
.login-error { color: #e74c5e; font-size: 0.9rem; margin-top: 12px; min-height: 1.2em; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(120, 60, 80, 0.85);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 300;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ 响应式 ============ */
@media (max-width: 640px) {
  .navbar-inner { flex-wrap: wrap; justify-content: center; border-radius: 22px; }
  .nav-link { padding: 7px 12px; font-size: 0.9rem; }
  .hero-title { font-size: 1.5rem; }
  .days-number { font-size: 3.4rem; }
  .page-head { justify-content: center; text-align: center; }
  .page-title { font-size: 1.6rem; }
  .card-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .card-grid { grid-template-columns: 1fr; }
}
