/* ============================================
   情侣网站样式 - 浪漫治愈风
   ============================================ */

:root {
  --primary: #ff6b9d;
  --primary-light: #ffb3c9;
  --primary-dark: #e8558a;
  --secondary: #a8e6cf;
  --accent: #ffd93d;
  --bg: #fff5f7;
  --bg-card: #ffffff;
  --text: #4a4a4a;
  --text-light: #888;
  --border: #ffe0e9;
  --shadow: 0 4px 20px rgba(255, 107, 157, 0.12);
  --shadow-hover: 0 8px 30px rgba(255, 107, 157, 0.2);
  --radius: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- 浮动爱心背景 ---- */
.hearts-bg {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.floating-heart {
  position: absolute; bottom: -30px;
  font-size: 20px; opacity: 0.3;
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.3; }
  50% { opacity: 0.6; }
  100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

/* ---- 登录页 ---- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ffe0ec 0%, #fff5f7 50%, #e8f5ff 100%);
  position: relative; z-index: 1;
}
.login-card {
  background: var(--bg-card); padding: 48px 40px; border-radius: 24px;
  box-shadow: var(--shadow); width: 100%; max-width: 400px; text-align: center;
  animation: fadeInUp 0.6s ease;
}
.login-hearts { font-size: 48px; margin-bottom: 12px; animation: heartbeat 1.5s ease infinite; }
.login-card h1 { color: var(--primary); font-size: 28px; margin-bottom: 8px; }
.login-subtitle { color: var(--text-light); margin-bottom: 32px; }
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- 表单 ---- */
.form-group { margin-bottom: 18px; text-align: left; }
.form-group label { display: block; font-size: 14px; color: var(--text-light); margin-bottom: 6px; }
input, textarea, select {
  width: 100%; padding: 12px 16px; border: 2px solid var(--border);
  border-radius: 12px; font-size: 15px; transition: all 0.3s;
  background: #fff; color: var(--text); outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,107,157,0.1);
}
textarea { resize: vertical; }

/* ---- 按钮 ---- */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border: none; padding: 12px 28px; border-radius: 12px;
  font-size: 15px; cursor: pointer; transition: all 0.3s; font-weight: 600;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-block { width: 100%; }
.btn-large { padding: 16px 48px; font-size: 18px; }
.btn-secondary {
  background: #fff; color: var(--primary); border: 2px solid var(--primary);
  padding: 10px 24px; border-radius: 12px; cursor: pointer; font-size: 14px;
  transition: all 0.3s;
}
.btn-secondary:hover { background: var(--primary); color: #fff; }
.btn-small {
  background: var(--primary-light); color: #fff; border: none;
  padding: 4px 12px; border-radius: 8px; cursor: pointer; font-size: 12px;
}
.btn-back {
  background: none; border: none; color: var(--primary); cursor: pointer;
  font-size: 15px; margin-bottom: 16px; padding: 4px 0;
}
.btn-logout {
  background: none; border: 1px solid var(--border); color: var(--text-light);
  padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
  margin-left: 10px; transition: all 0.3s;
}
.btn-logout:hover { border-color: var(--primary); color: var(--primary); }

.login-error { color: #e74c3c; font-size: 14px; margin-top: 12px; min-height: 20px; }
.init-section { margin-top: 20px; }
.init-section hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.init-hint { font-size: 14px; color: var(--text-light); }
.init-hint a { color: var(--primary); text-decoration: none; }

/* ---- 导航栏 ---- */
.navbar {
  background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
  padding: 0 32px; height: 64px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(255,107,157,0.08);
}
.nav-brand { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 18px; font-weight: 700; color: var(--primary); }
.nav-heart { animation: heartbeat 1.5s ease infinite; }
.nav-menu { display: flex; gap: 4px; }
.nav-item {
  text-decoration: none; color: var(--text); padding: 8px 16px;
  border-radius: 10px; font-size: 14px; transition: all 0.3s;
}
.nav-item:hover, .nav-item.active { background: var(--primary-light); color: #fff; }
.nav-user { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary-light); }
.nav-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--primary); }
.mobile-menu {
  display: none; position: fixed; top: 64px; left: 0; right: 0;
  background: #fff; padding: 16px; z-index: 99; box-shadow: var(--shadow);
  flex-direction: column; gap: 4px;
}
.mobile-nav-item {
  padding: 12px 16px; border-radius: 10px; text-decoration: none;
  color: var(--text); font-size: 15px;
}
.mobile-nav-item:hover { background: var(--primary-light); color: #fff; }

/* ---- 主内容 ---- */
.app { position: relative; z-index: 1; }
.main-content { max-width: 1100px; margin: 0 auto; padding: 32px 24px; min-height: calc(100vh - 64px - 60px); }
.page { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.page-header h2 { color: var(--primary); font-size: 24px; }

/* ---- 首页 ---- */
.home-hero { text-align: center; margin-bottom: 40px; }
.home-title { font-size: 36px; color: var(--primary); margin-bottom: 8px; }
.home-slogan { font-size: 18px; color: var(--text-light); }

.couple-card {
  display: flex; align-items: center; justify-content: center; gap: 40px;
  background: var(--bg-card); padding: 48px; border-radius: 24px;
  box-shadow: var(--shadow); margin-bottom: 32px; flex-wrap: wrap;
}
.person-card { text-align: center; flex: 1; min-width: 160px; }
.avatar-ring {
  width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 16px;
  padding: 4px; background: linear-gradient(135deg, var(--primary), var(--accent));
  animation: pulse-ring 2s ease infinite;
}
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,157,0.3); }
  50% { box-shadow: 0 0 0 12px rgba(255,107,157,0); }
}
.avatar-lg { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #eee; }
.person-card h2 { font-size: 22px; color: var(--text); margin-bottom: 6px; }
.person-sign { font-size: 13px; color: var(--text-light); font-style: italic; }

.love-center { text-align: center; flex: 1; min-width: 200px; }
.heart-beat { font-size: 48px; animation: heartbeat 1.2s ease infinite; margin-bottom: 12px; }
.days-counter { margin: 16px 0; }
.days-number {
  font-size: 64px; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; line-height: 1;
}
.days-label { font-size: 14px; color: var(--text-light); margin-top: 4px; }
.time-detail { font-size: 15px; color: var(--primary); margin: 8px 0; font-weight: 600; }
.love-date { font-size: 13px; color: var(--text-light); }

.home-quote {
  text-align: center; padding: 24px; background: var(--bg-card);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 32px;
  font-size: 17px; color: var(--primary); font-style: italic;
}

.quick-nav { text-align: center; }
.quick-nav h3 { color: var(--text); margin-bottom: 20px; font-size: 18px; }
.quick-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  max-width: 600px; margin: 0 auto;
}
.quick-item {
  background: var(--bg-card); padding: 20px 12px; border-radius: var(--radius);
  cursor: pointer; transition: all 0.3s; display: flex; flex-direction: column;
  align-items: center; gap: 8px; box-shadow: var(--shadow); font-size: 14px;
}
.quick-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.quick-item span:first-child { font-size: 28px; }

/* ---- 相册 ---- */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.album-card {
  background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: all 0.3s; box-shadow: var(--shadow);
}
.album-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.album-cover {
  width: 100%; height: 160px; object-fit: cover;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  display: flex; align-items: center; justify-content: center; font-size: 48px;
}
.album-info { padding: 16px; }
.album-info h4 { font-size: 16px; margin-bottom: 4px; }
.album-info p { font-size: 13px; color: var(--text-light); }
.album-actions { display: flex; gap: 8px; margin-top: 8px; }

.photo-upload-area { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; align-items: center; }
.input-inline { width: auto; flex: 1; min-width: 150px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.photo-item {
  position: relative; border-radius: 12px; overflow: hidden; cursor: pointer;
  aspect-ratio: 1; box-shadow: var(--shadow);
}
.photo-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.photo-item:hover img { transform: scale(1.08); }
.photo-delete {
  position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.5);
  color: #fff; border: none; width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; font-size: 14px; opacity: 0; transition: opacity 0.3s;
}
.photo-item:hover .photo-delete { opacity: 1; }

/* ---- 经期 ---- */
.period-predict-card {
  background: linear-gradient(135deg, #ffe0ec, #fff); padding: 28px;
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 28px;
}
.predict-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-top: 16px; }
.predict-item { text-align: center; padding: 16px; background: #fff; border-radius: 12px; }
.predict-item .label { font-size: 13px; color: var(--text-light); margin-bottom: 6px; }
.predict-item .value { font-size: 20px; font-weight: 700; color: var(--primary); }
.period-list { display: flex; flex-direction: column; gap: 12px; }
.period-item {
  background: var(--bg-card); padding: 16px 20px; border-radius: 12px;
  box-shadow: var(--shadow); display: flex; justify-content: space-between; align-items: center;
}
.period-item .dates { font-weight: 600; }
.period-item .meta { font-size: 13px; color: var(--text-light); }

/* ---- 纪念日 ---- */
.anniversary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.anniversary-card {
  background: var(--bg-card); padding: 24px; border-radius: var(--radius);
  box-shadow: var(--shadow); text-align: center; position: relative; overflow: hidden;
  transition: all 0.3s;
}
.anniversary-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.anniversary-card .icon { font-size: 40px; margin-bottom: 12px; }
.anniversary-card h4 { font-size: 18px; margin-bottom: 8px; }
.anniversary-card .date { font-size: 14px; color: var(--text-light); margin-bottom: 12px; }
.anniversary-card .countdown {
  font-size: 32px; font-weight: 800; color: var(--primary);
}
.anniversary-card .countdown-label { font-size: 12px; color: var(--text-light); }
.anniversary-card .notes { font-size: 13px; color: var(--text-light); margin-top: 10px; font-style: italic; }
.anniversary-card .actions { margin-top: 12px; display: flex; gap: 8px; justify-content: center; }

/* ---- 惩罚面板 ---- */
.punish-wheel-section {
  text-align: center; background: var(--bg-card); padding: 40px;
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 28px;
}
.wheel-result {
  font-size: 24px; font-weight: 700; color: var(--primary);
  min-height: 60px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px; padding: 16px; background: var(--bg); border-radius: 12px;
}
.punish-record-form { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.punish-record-form select, .punish-record-form input { width: auto; flex: 1; min-width: 140px; }
.punish-section { margin-bottom: 28px; }
.punish-section h3 { margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.punish-list { display: flex; flex-wrap: wrap; gap: 10px; }
.punish-tag {
  background: var(--bg-card); padding: 10px 18px; border-radius: 20px;
  box-shadow: var(--shadow); font-size: 14px; display: flex; align-items: center; gap: 8px;
}
.punish-tag .del { color: #ccc; cursor: pointer; font-size: 16px; }
.punish-tag .del:hover { color: #e74c3c; }
.punish-records { display: flex; flex-direction: column; gap: 10px; }
.punish-record-item {
  background: var(--bg-card); padding: 14px 20px; border-radius: 12px;
  box-shadow: var(--shadow); display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
}
.punish-record-item.done { opacity: 0.6; }
.punish-record-item .content { font-weight: 600; }
.punish-record-item .meta { font-size: 13px; color: var(--text-light); }

/* ---- 菜谱 ---- */
.recipe-random { text-align: center; margin-bottom: 24px; }
.recipe-random #randomRecipeResult { margin-top: 16px; font-size: 18px; color: var(--primary); font-weight: 600; }
.recipe-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.tab {
  background: var(--bg-card); border: 2px solid var(--border); padding: 8px 20px;
  border-radius: 20px; cursor: pointer; font-size: 14px; transition: all 0.3s; color: var(--text);
}
.tab.active, .tab:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.recipe-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); transition: all 0.3s;
}
.recipe-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.recipe-card h4 { font-size: 18px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.recipe-card .cat-tag {
  font-size: 11px; background: var(--primary-light); color: #fff;
  padding: 2px 10px; border-radius: 10px;
}
.recipe-card .difficulty { font-size: 13px; color: var(--accent); margin-bottom: 8px; }
.recipe-card .ingredients { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.recipe-card .steps { font-size: 13px; color: var(--text); white-space: pre-line; margin-bottom: 12px; }
.recipe-card .actions { display: flex; gap: 8px; }
.wish-badge { color: var(--accent); }
.cooked-badge { color: var(--secondary); font-size: 12px; }

/* ---- 留言板 ---- */
.message-input-area {
  background: var(--bg-card); padding: 20px; border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 24px;
}
.message-input-area textarea { margin-bottom: 12px; }
.message-list { display: flex; flex-direction: column; gap: 16px; }
.message-item {
  background: var(--bg-card); padding: 16px 20px; border-radius: var(--radius);
  box-shadow: var(--shadow); max-width: 80%;
}
.message-item.mine { align-self: flex-end; background: linear-gradient(135deg, var(--primary-light), #fff); }
.message-item .sender { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.message-item .sender img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.message-item .sender .name { font-weight: 600; font-size: 14px; }
.message-item .sender .time { font-size: 12px; color: var(--text-light); }
.message-item .content { font-size: 15px; line-height: 1.6; }

/* ---- 愿望清单 ---- */
.wishlist-progress {
  background: var(--bg-card); padding: 20px; border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 24px;
}
.progress-bar { height: 12px; background: var(--border); border-radius: 6px; overflow: hidden; margin-top: 10px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 6px; transition: width 0.5s; }
.wishlist-container { display: flex; flex-direction: column; gap: 10px; }
.wish-item {
  background: var(--bg-card); padding: 16px 20px; border-radius: 12px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
  transition: all 0.3s;
}
.wish-item.done { opacity: 0.6; }
.wish-item.done .wish-text { text-decoration: line-through; }
.wish-checkbox {
  width: 24px; height: 24px; border: 2px solid var(--primary); border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.3s; font-size: 14px; color: #fff;
}
.wish-item.done .wish-checkbox { background: var(--primary); }
.wish-text { flex: 1; font-size: 15px; }
.wish-date { font-size: 12px; color: var(--text-light); }
.wish-del { color: #ccc; cursor: pointer; font-size: 18px; }
.wish-del:hover { color: #e74c3c; }

/* ---- 日记 ---- */
.diary-list { display: flex; flex-direction: column; gap: 16px; }
.diary-card {
  background: var(--bg-card); padding: 24px; border-radius: var(--radius);
  box-shadow: var(--shadow); transition: all 0.3s;
}
.diary-card:hover { box-shadow: var(--shadow-hover); }
.diary-card .diary-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.diary-card h4 { font-size: 18px; }
.diary-card .diary-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-light); }
.diary-card .diary-meta img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.diary-card .diary-content { font-size: 15px; line-height: 1.8; color: var(--text); white-space: pre-line; }
.diary-card .mood { font-size: 20px; }
.diary-card .actions { margin-top: 12px; display: flex; gap: 8px; }

/* ---- 弹窗 ---- */
.modal {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center;
  padding: 20px;
}
.modal.show { display: flex; }
.modal-content {
  background: #fff; padding: 32px; border-radius: 20px; max-width: 500px; width: 100%;
  max-height: 90vh; overflow-y: auto; position: relative; animation: fadeInUp 0.3s ease;
}
.modal-large { max-width: 700px; }
.modal-content h2 { color: var(--primary); margin-bottom: 8px; }
.modal-desc { color: var(--text-light); margin-bottom: 20px; font-size: 14px; }
.modal-close {
  position: absolute; top: 16px; right: 20px; background: none; border: none;
  font-size: 28px; cursor: pointer; color: var(--text-light);
}
.init-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.init-col h3 { margin-bottom: 12px; text-align: center; }
.init-col input { margin-bottom: 10px; }

/* ---- 图片查看器 ---- */
.image-viewer {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.9); z-index: 2000; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.image-viewer.show { display: flex; }
.image-viewer img { max-width: 90%; max-height: 90%; border-radius: 8px; }

/* ---- Toast ---- */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 12px 28px; border-radius: 12px;
  font-size: 14px; z-index: 3000; opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.success { background: #2ecc71; }
.toast.error { background: #e74c3c; }

/* ---- 底部 ---- */
.footer {
  text-align: center; padding: 20px; color: var(--text-light); font-size: 13px;
  background: rgba(255,255,255,0.5);
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .nav-menu { display: none; }
  .nav-toggle { display: block; }
  .mobile-menu.open { display: flex; }
  .couple-card { padding: 24px; gap: 20px; }
  .days-number { font-size: 48px; }
  .home-title { font-size: 28px; }
  .quick-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .quick-item { padding: 14px 8px; font-size: 12px; }
  .quick-item span:first-child { font-size: 22px; }
  .main-content { padding: 20px 16px; }
  .init-grid { grid-template-columns: 1fr; }
  .message-item { max-width: 95%; }
  .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
}
@media (max-width: 480px) {
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .avatar-ring { width: 90px; height: 90px; }
  .days-number { font-size: 40px; }
}
