/* pages.css —— 各页面专属样式 */

/* ===== 主题页面 ===== */
.theme-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.theme-item {
  flex: 1 1 130px; min-width: 0; cursor: pointer;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--card); transition: transform 0.15s ease;
}
.theme-item:active { transform: scale(0.97); }
.theme-preview { height: 64px; }
.theme-preview-pink { background: linear-gradient(160deg, #FFF0F3, #FFD9E0 55%, #FFE9C9); }
.theme-preview-simple { background: linear-gradient(160deg, #F7F9FA, #EDF1F4 60%, #E6ECEF); }
.theme-preview-star { background: linear-gradient(160deg, #0E1428, #1B2350 55%, #2C1E4F); }
.theme-preview-retro { background: linear-gradient(160deg, #F7F0E3, #EFE2C8 55%, #E5D5B5); }
.theme-name { font-size: 13px; padding: 6px 10px; }
.bg-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.bg-current {
  width: 100%; height: 120px; border-radius: 10px;
  background-size: cover; background-position: center;
  border: 1px solid var(--border);
}

/* ===== 首页 ===== */
.home-hero { text-align: center; padding: 26px 14px 18px; }
.home-hero .welcome { font-size: 14px; color: var(--text-secondary); }
.home-hero .days { font-size: 42px; font-weight: 700; color: var(--accent-text); line-height: 1.3; }
.home-hero .days-label { font-size: 13px; color: var(--text-secondary); }
.home-countdown { text-align: center; padding: 10px; }
.home-countdown .name { font-size: 14px; color: var(--text); }
.home-countdown .num { font-size: 26px; font-weight: 700; color: var(--accent-text); }
.home-entries { display: flex; flex-wrap: wrap; gap: 10px; }
.home-entry {
  flex: 1 1 40%; min-width: 0; text-align: center; cursor: pointer;
  background: var(--accent-soft); color: var(--accent-text);
  border-radius: 12px; padding: 14px 8px; font-size: 14px; font-weight: 600;
}
.home-entry:active { transform: scale(0.97); }
.home-recent-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.home-recent-item:last-child { border-bottom: none; }

/* ===== 记账 ===== */
.ledger-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ledger-month {
  display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600;
}
.ledger-month .arrow {
  border: none; background: var(--accent-soft); color: var(--accent-text);
  width: 34px; height: 34px; border-radius: 50%; font-size: 15px; cursor: pointer;
}
.ledger-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-card { flex: 1 1 120px; min-width: 0; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); }
.stat-card .k { font-size: 12px; color: var(--text-secondary); }
.stat-card .v { font-size: 20px; font-weight: 700; color: var(--accent-text); }
.expense-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.expense-item:last-child { border-bottom: none; }
.expense-who {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #FFFFFF;
}
.who-month { background: #F58FA6; }
.who-egg { background: #8BC8EA; }
.expense-main { flex: 1; min-width: 0; }
.expense-main .cat { font-size: 14px; font-weight: 600; }
.expense-main .meta { font-size: 12px; color: var(--text-secondary); }
.expense-amt { font-size: 15px; font-weight: 700; color: var(--text); }
.expense-del { border: none; background: transparent; color: var(--text-secondary); font-size: 16px; cursor: pointer; padding: 6px; }
.fab {
  position: fixed; right: 18px; bottom: 84px;
  width: 54px; height: 54px; border-radius: 50%; border: none;
  background: var(--accent); color: #FFFFFF; font-size: 26px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); z-index: 30;
}
@media (min-width: 720px) { .fab { bottom: 30px; } }
.who-toggle { display: flex; gap: 10px; }
.who-toggle button {
  flex: 1; padding: 9px 0; border-radius: 22px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 14px; cursor: pointer; min-height: 42px;
}
.who-toggle button.active-who { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-chip {
  padding: 7px 14px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 13px; cursor: pointer;
}
.cat-chip.active-cat { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }

/* ===== 宠物 ===== */
.pet-stage { text-align: center; padding: 8px 0 4px; }
.pet-name { font-size: 18px; font-weight: 700; margin-top: 4px; }
.pet-figure { font-size: 72px; line-height: 1.1; }
.pet-figure.bounce { animation: pet-bounce 0.5s ease; }
@keyframes pet-bounce { 0%{transform:translateY(0);} 40%{transform:translateY(-12px) scale(1.05);} 100%{transform:translateY(0);} }
.stat-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.stat-row .k { width: 58px; font-size: 13px; color: var(--text-secondary); }
.stat-bar { flex: 1; height: 10px; border-radius: 6px; background: rgba(0,0,0,0.08); overflow: hidden; }
.stat-fill { height: 100%; border-radius: 6px; transition: width 0.4s ease; }
.fill-hunger { background: linear-gradient(90deg, #F4B393, #F58FA6); }
.fill-affection { background: linear-gradient(90deg, #8BC8EA, #B39DDB); }
.stat-val { width: 40px; text-align: right; font-size: 12px; color: var(--text-secondary); }
.pet-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pet-log-item {
  display: flex; justify-content: space-between; padding: 7px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.pet-log-item:last-child { border-bottom: none; }
.pet-edit-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.pet-edit-row input { flex: 1; }
.avatar-row { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-opt {
  width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--card); font-size: 30px; cursor: pointer; line-height: 50px; text-align: center;
}
.avatar-opt.active-av { border-color: var(--accent); background: var(--accent-soft); }

/* ===== 纪念日 ===== */
.anni-card { display: flex; align-items: center; gap: 12px; }
.anni-icon {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.anni-main { flex: 1; min-width: 0; }
.anni-main .name { font-size: 15px; font-weight: 600; }
.anni-main .meta { font-size: 12px; color: var(--text-secondary); }
.anni-count { text-align: right; }
.anni-count .num { font-size: 15px; font-weight: 700; color: var(--accent-text); }
.anni-count .tag { font-size: 11px; color: var(--text-secondary); }
.derived-tag { font-size: 11px; color: var(--text-secondary); }
.anni-del { border: none; background: transparent; color: var(--text-secondary); font-size: 16px; cursor: pointer; padding: 6px; }

/* ===== 相册 ===== */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.album-item { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--border); }
.album-item img, .album-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-item .vid-mark {
  position: absolute; right: 4px; bottom: 4px; font-size: 11px; color: #FFFFFF;
  background: rgba(0,0,0,0.5); border-radius: 4px; padding: 1px 6px;
}
.album-item .chk {
  position: absolute; left: 4px; top: 4px; width: 22px; height: 22px;
  border-radius: 50%; border: 2px solid #FFFFFF; background: rgba(0,0,0,0.3);
}
.album-item .chk.checked { background: var(--accent); border-color: var(--accent); }
.album-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.88); z-index: 120;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.lightbox img, .lightbox video { max-width: 100%; max-height: 92vh; border-radius: 8px; }
.lightbox .lb-close {
  position: absolute; top: 14px; right: 14px; width: 40px; height: 40px;
  border-radius: 50%; border: none; background: rgba(255,255,255,0.15); color: #FFFFFF;
  font-size: 18px; cursor: pointer;
}
.load-more { text-align: center; margin-top: 10px; }
