/* ============================================================
   我们的小窝 · 样式
   ============================================================ */

:root {
  --pink: #ff6b9d;
  --pink-deep: #e8467f;
  --peach: #ff9a76;
  --text: #5b3a4b;
  --text-light: #8a5f73;
  --card: rgba(255, 255, 255, 0.82);
  --shadow: 0 8px 30px rgba(232, 70, 127, 0.14);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, #fff0f5 0%, #ffe1ec 45%, #ffd3e4 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ---------- 漂浮爱心背景 ---------- */
#hearts-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.f-heart {
  position: absolute;
  bottom: -40px;
  opacity: 0.65;
  animation: floatUp linear forwards;
}
@keyframes floatUp {
  to { transform: translateY(-115vh) rotate(35deg); opacity: 0; }
}

/* ---------- 顶部 ---------- */
.site-header { text-align: center; padding: 34px 16px 10px; position: relative; z-index: 1; }
.couple { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.couple .name { font-size: 22px; font-weight: 700; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 30px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.heart-beat { font-size: 26px; animation: heartBeat 1.4s ease-in-out infinite; }
@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.25); }
  40% { transform: scale(1); }
}
.site-title {
  margin-top: 10px;
  font-size: clamp(24px, 5vw, 34px);
  background: linear-gradient(135deg, var(--pink-deep), var(--peach));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- 导航 ---------- */
.tabs {
  position: sticky; top: 10px; z-index: 50;
  display: flex; gap: 6px; justify-content: center;
  margin: 16px auto 20px; padding: 6px;
  width: fit-content; max-width: calc(100vw - 20px);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: 999px; box-shadow: var(--shadow);
}
.tab-btn {
  border: none; background: transparent; cursor: pointer;
  padding: 9px 14px; border-radius: 999px;
  font-size: 14px; color: var(--text-light);
  transition: all 0.25s; white-space: nowrap;
  touch-action: manipulation;
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--pink), var(--peach));
  color: #fff; box-shadow: 0 4px 14px rgba(232, 70, 127, 0.35);
}

/* ---------- 页面区块 ---------- */
main { position: relative; z-index: 1; }
.page { display: none; max-width: 880px; margin: 0 auto; padding: 4px 16px 44px; }
.page.active { display: block; animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.section-title { text-align: center; margin: 6px 0 20px; }
.section-title h2 { font-size: 22px; color: var(--pink-deep); }
.section-title p { font-size: 13px; color: var(--text-light); margin-top: 6px; }

.card {
  background: var(--card);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 22px; box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.9);
  padding: 26px;
}

.tip { text-align: center; font-size: 12.5px; color: var(--text-light); margin-top: 18px; line-height: 1.8; }
.tip code {
  background: rgba(232, 70, 127, 0.1); color: var(--pink-deep);
  padding: 2px 6px; border-radius: 6px; font-size: 12px;
}

/* ---------- 首页 · 恋爱计时 ---------- */
.hero-card { text-align: center; padding: 40px 22px 34px; }
.hero-label { font-size: 16px; color: var(--text-light); letter-spacing: 2px; }
.love-days { margin: 6px 0 2px; line-height: 1.15; }
.love-days span#loveDays {
  font-size: clamp(64px, 16vw, 104px); font-weight: 800; font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--pink-deep), var(--peach));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.love-days .unit { font-size: clamp(20px, 4vw, 28px); font-weight: 700; color: var(--pink-deep); margin-left: 6px; }
.love-hms { display: flex; justify-content: center; gap: 18px; font-size: 15px; color: var(--text-light); }
.love-hms b { font-size: 20px; color: var(--text); font-variant-numeric: tabular-nums; }
.since { margin-top: 14px; font-size: 13px; color: var(--text-light); }
.anni-chip {
  display: inline-block; margin-top: 14px; padding: 8px 18px;
  background: linear-gradient(135deg, #ffe3ec, #ffd1e0);
  border-radius: 999px; font-size: 14px; color: var(--pink-deep);
}
.sweet-btn {
  margin-top: 22px; padding: 12px 30px;
  border: none; border-radius: 999px; cursor: pointer;
  font-size: 16px; color: #fff; font-weight: 600;
  background: linear-gradient(135deg, var(--pink), var(--peach));
  box-shadow: 0 6px 18px rgba(232, 70, 127, 0.35);
  transition: transform 0.15s; touch-action: manipulation;
}
.sweet-btn:active { transform: scale(0.94); }
.sweet-word {
  margin-top: 14px; min-height: 24px; font-size: 16px; color: var(--pink-deep);
  animation: popIn 0.45s ease;
}
@keyframes popIn { 0% { opacity: 0; transform: scale(0.6); } 100% { opacity: 1; transform: scale(1); } }

/* ---------- 出去玩倒计时 ---------- */
#tripList { display: grid; gap: 16px; }
.trip-card { display: flex; gap: 16px; align-items: flex-start; position: relative; padding: 22px; }
.trip-emoji {
  flex-shrink: 0; width: 62px; height: 62px; border-radius: 18px;
  background: linear-gradient(135deg, #ffe3ec, #ffd1e0);
  display: flex; align-items: center; justify-content: center; font-size: 34px;
}
.trip-info { flex: 1; min-width: 0; }
.trip-info h3 { font-size: 18px; margin-bottom: 4px; }
.trip-date { font-size: 13px; color: var(--text-light); }
.trip-note { font-size: 13px; color: var(--text-light); margin-top: 4px; }
.trip-count { margin-top: 10px; font-size: 14px; color: var(--text); }
.trip-count b { font-size: 20px; color: var(--pink-deep); font-variant-numeric: tabular-nums; margin: 0 2px; }
.trip-status {
  position: absolute; top: 14px; right: 14px;
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  background: #ffe3ec; color: var(--pink-deep); white-space: nowrap;
}
.trip-status.today { background: #fff3c4; color: #b07d00; animation: popIn 0.4s ease; }
.trip-status.done { background: #e8f7ee; color: #2f9e63; }

/* ---------- 照片墙 ---------- */
.masonry { columns: 2; column-gap: 14px; }
@media (min-width: 700px) { .masonry { columns: 3; } }
.ph-item {
  break-inside: avoid; margin-bottom: 14px; position: relative;
  border-radius: 16px; overflow: hidden; cursor: zoom-in;
  box-shadow: 0 6px 20px rgba(232, 70, 127, 0.16);
  border: 3px solid #fff;
  transition: transform 0.25s;
}
.ph-item:hover { transform: translateY(-3px) scale(1.01); }
.ph-item img { width: 100%; display: block; }
.ph-item .ph-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 12px 10px; font-size: 13px; color: #fff;
  background: linear-gradient(transparent, rgba(80, 20, 50, 0.65));
}

/* ---------- 照片大图 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(30, 8, 20, 0.9);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  animation: fadeIn 0.25s ease;
}
.lightbox img { max-width: 92vw; max-height: 78vh; border-radius: 12px; box-shadow: 0 10px 50px rgba(0,0,0,.5); }
.lb-caption { margin-top: 14px; color: #ffd9e8; font-size: 14px; padding: 0 60px; text-align: center; }
.lb-btn {
  position: absolute; border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.14); color: #fff;
  width: 44px; height: 44px; border-radius: 50%;
  font-size: 22px; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; touch-action: manipulation;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.3); }
.lb-close { top: 18px; right: 18px; font-size: 17px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

/* ---------- 小游戏 ---------- */
.games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.game-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 28px 18px; cursor: pointer; text-align: center;
  transition: transform 0.2s, box-shadow 0.2s; touch-action: manipulation;
  font-family: inherit;
}
.game-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(232, 70, 127, 0.22); }
.game-emoji { font-size: 44px; }
.game-name { font-size: 17px; font-weight: 700; color: var(--text); }
.game-desc { font-size: 13px; color: var(--text-light); line-height: 1.6; }

.back-btn {
  display: block; margin: 0 auto 16px; padding: 8px 20px;
  border: none; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, 0.8); color: var(--text-light); font-size: 14px;
  box-shadow: var(--shadow); touch-action: manipulation;
}

.game-panel { text-align: center; padding: 24px 18px; user-select: none; }
.game-panel h3 { color: var(--pink-deep); margin-bottom: 8px; font-size: 20px; }
.game-hint { font-size: 13px; color: var(--text-light); margin-top: 14px; line-height: 1.8; }
.game-hud {
  display: flex; justify-content: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 16px; font-size: 14px; color: var(--text-light);
}
.game-hud b { color: var(--pink-deep); font-size: 17px; font-variant-numeric: tabular-nums; }
.mini-btn {
  border: none; cursor: pointer; padding: 6px 16px; border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), var(--peach));
  color: #fff; font-size: 13px; touch-action: manipulation;
}
.primary-btn {
  border: none; cursor: pointer; padding: 12px 34px; border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), var(--peach));
  color: #fff; font-size: 16px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(232, 70, 127, 0.35);
  transition: transform 0.15s; touch-action: manipulation; font-family: inherit;
}
.primary-btn:active { transform: scale(0.95); }

/* 翻翻乐 */
.mem-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  max-width: 400px; margin: 0 auto;
}
.mem-card {
  aspect-ratio: 1; border: none; cursor: pointer; border-radius: 14px;
  background: linear-gradient(135deg, #ff8fab, #ff6b9d);
  box-shadow: 0 4px 12px rgba(232, 70, 127, 0.25);
  font-size: 30px; color: #fff; transition: all 0.25s; touch-action: manipulation;
  display: flex; align-items: center; justify-content: center;
}
.mem-card .mem-back { display: none; }
.mem-card.flipped { background: #fff; transform: rotateY(180deg) scale(0.96); }
.mem-card.flipped .mem-front { display: none; }
.mem-card.flipped .mem-back { display: inline; animation: popIn 0.3s ease; }
.mem-card.matched { opacity: 0.5; pointer-events: none; box-shadow: 0 0 0 3px #b6e2c8 inset; }

/* 接住小心心 */
.canvas-wrap { position: relative; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
#cCanvas { display: block; width: 100%; background: linear-gradient(180deg, #fff5f8, #ffe6ef); touch-action: none; }
.canvas-overlay {
  position: absolute; inset: 0; z-index: 5;
  background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(4px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 20px; text-align: center;
}
.canvas-overlay p { font-size: 16px; line-height: 1.9; }
.canvas-overlay small { color: var(--text-light); font-size: 13px; }
.result-score { font-size: 52px; font-weight: 800; color: var(--pink-deep); }

/* 默契问答 */
.quiz-panel { max-width: 480px; margin: 0 auto; }
.quiz-panel input {
  border: 2px solid #ffd0e0; border-radius: 12px; padding: 10px 14px;
  font-size: 15px; width: 130px; text-align: center; outline: none;
  color: var(--text); background: #fff; margin: 0 6px;
}
.quiz-panel input:focus { border-color: var(--pink); }
.quiz-progress { font-size: 12px; color: var(--text-light); margin-bottom: 10px; letter-spacing: 1px; }
.quiz-question { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.quiz-sub { font-size: 13px; color: var(--text-light); margin-bottom: 18px; }
.quiz-opts { display: grid; gap: 12px; }
.quiz-opt {
  border: 2px solid #ffd0e0; background: #fff; border-radius: 16px;
  padding: 16px; font-size: 16px; cursor: pointer; color: var(--text);
  transition: all 0.2s; touch-action: manipulation; font-family: inherit;
}
.quiz-opt:hover { border-color: var(--pink); transform: translateY(-2px); }
.quiz-result-big { font-size: 60px; margin: 8px 0; }

/* ---------- 联机房间条 ---------- */
.net-bar { margin-bottom: 18px; padding: 18px 22px; }
.net-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.net-title { font-size: 15px; font-weight: 700; color: var(--text); }
.net-sep { font-size: 13px; color: var(--text-light); }
.net-btn { padding: 8px 18px; font-size: 14px; }
.net-leave { background: #fff; color: var(--text-light); box-shadow: inset 0 0 0 1.5px #f3c1d3; }
#netCode {
  width: 92px; text-align: center; font-size: 16px; letter-spacing: 4px;
  border: 2px solid #ffd0e0; border-radius: 10px; padding: 7px 6px; outline: none;
  color: var(--text); background: #fff;
}
#netCode:focus { border-color: var(--pink); }
.net-code { font-size: 22px; color: var(--pink-deep); letter-spacing: 3px; }
.net-status { font-size: 14px; color: var(--text-light); }
.net-status.ok { color: #2f9e63; font-weight: 700; }
.net-hint { margin-top: 10px; text-align: center; font-size: 12.5px; color: var(--text-light); line-height: 1.7; }

.online-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; margin-left: 8px;
  background: linear-gradient(135deg, #d9f5e5, #b9ecd0);
  color: #22854f; font-size: 11px; font-weight: 700; vertical-align: middle;
}
.online-strip { text-align: center; font-size: 13px; color: var(--text-light); margin-bottom: 12px; }
.online-strip b { color: var(--pink-deep); }
.score-duo { display: flex; justify-content: center; gap: 26px; margin-bottom: 12px; font-size: 14px; }
.score-duo b { font-size: 20px; color: var(--pink-deep); font-variant-numeric: tabular-nums; }

/* ---------- 页脚 ---------- */
.site-footer { text-align: center; padding: 26px 0 40px; font-size: 13px; color: var(--text-light); position: relative; z-index: 1; }

/* ---------- 小屏适配 ---------- */
@media (max-width: 480px) {
  .tab-btn { padding: 8px 10px; font-size: 13px; }
  .trip-card { padding: 18px; }
  .trip-emoji { width: 50px; height: 50px; font-size: 27px; border-radius: 14px; }
  .card { padding: 20px; }
  .lb-prev, .lb-next { width: 38px; height: 38px; }
}
