/* ============================================================
   沈柠汐成长记录 | 淡紫低饱和母婴风主题
   ============================================================ */
:root {
  --bg: #f7f4fb;
  --bg-soft: #fdfcff;
  --card: #ffffff;
  --sidebar: #f1ebf9;
  --sidebar-hover: #e6dcf5;
  --primary: #9b7fd4;
  --primary-dark: #7d5fb8;
  --primary-light: #c9b8ec;
  --accent: #d8b4e2;
  --pink: #e8b4c8;
  --text: #4a4458;
  --text-light: #8a8499;
  --text-faint: #b5aec4;
  --border: #e8e2f2;
  --green: #8fc9a8;
  --green-bg: #e8f5ee;
  --red: #d98a8a;
  --red-bg: #fbeaea;
  --yellow: #e5c07b;
  --yellow-bg: #faf3e0;
  --blue: #8ab4d8;
  --blue-bg: #e8f1f9;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(155, 127, 212, 0.08);
  --shadow-hover: 0 4px 20px rgba(155, 127, 212, 0.16);
  --sidebar-w: 232px;
  --sidebar-w-collapsed: 72px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width 0.25s ease;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar.collapsed { width: var(--sidebar-w-collapsed); }

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.sidebar-title { font-size: 15px; font-weight: 700; color: var(--primary-dark); white-space: nowrap; }
.sidebar-sub { font-size: 11px; color: var(--text-light); white-space: nowrap; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 2px 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover { background: var(--sidebar-hover); }
.nav-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

.nav-icon { font-size: 18px; width: 28px; text-align: center; flex-shrink: 0; }
.nav-text { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }

.collapse-btn {
  width: 100%;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 14px;
  text-align: center;
}
.collapse-btn:hover { background: var(--sidebar-hover); color: var(--primary-dark); }

.sidebar.collapsed .nav-text,
.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .sidebar-sub { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 18px 8px; }

/* ---------- 主内容区 ---------- */
.main {
  flex: 1;
  padding: 24px 28px;
  min-width: 0;
  max-width: 1100px;
  margin: 0 auto;
}

.page-header { margin-bottom: 20px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 10px; }
.page-desc { color: var(--text-light); margin-top: 4px; font-size: 13px; }
.page-age-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 10px;
  vertical-align: middle;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 18px 20px;
  margin-bottom: 16px;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* ---------- 概览卡片(首页) ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.dash-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.dash-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

.dash-icon { font-size: 26px; margin-bottom: 8px; display: block; }
.dash-label { font-size: 12px; color: var(--text-light); }
.dash-value { font-size: 22px; font-weight: 700; color: var(--text); margin-top: 2px; }
.dash-value small { font-size: 13px; font-weight: 400; color: var(--text-light); }
.dash-sub { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

.baby-hero {
  background: linear-gradient(135deg, #f1ebf9 0%, #f9eef7 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.baby-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(155,127,212,0.3);
}

.baby-name { font-size: 20px; font-weight: 700; }
.baby-age-info { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
.age-pill {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 13px;
}
.age-pill b { color: var(--primary-dark); font-size: 16px; }

/* ---------- 表单 ---------- */
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; color: var(--text-light); font-weight: 600; }
.form-group input, .form-group select, .form-group textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-soft);
  color: var(--text);
  outline: none;
  transition: border 0.15s, box-shadow 0.15s;
  min-width: 0;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(155,127,212,0.15);
}
.form-group textarea { resize: vertical; min-height: 60px; }
.form-group input[type="number"] { width: 110px; }
.form-group input[type="date"] { width: 150px; }

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-soft { background: var(--primary-light); color: var(--primary-dark); }
.btn-soft:hover { background: var(--sidebar-hover); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-danger:hover { background: #f5d9d9; }
.btn-ghost { background: transparent; color: var(--text-light); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--primary-dark); border-color: var(--primary-light); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--text-light); font-weight: 600; font-size: 12px; white-space: nowrap; }
tr:hover td { background: var(--bg-soft); }

/* ---------- 徽章/状态 ---------- */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.badge-done { background: var(--green-bg); color: var(--green); }
.badge-pending { background: var(--yellow-bg); color: #b8860b; }
.badge-due { background: var(--red-bg); color: var(--red); }
.badge-info { background: var(--blue-bg); color: var(--blue); }

/* ---------- 列表项 ---------- */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.list-item:last-child { border-bottom: none; }
.item-icon { font-size: 22px; width: 36px; text-align: center; flex-shrink: 0; }
.item-main { flex: 1; min-width: 120px; }
.item-title { font-weight: 600; }
.item-sub { font-size: 12px; color: var(--text-light); }
.item-right { text-align: right; flex-shrink: 0; }
.item-value { font-weight: 700; color: var(--primary-dark); }
.item-time { font-size: 12px; color: var(--text-faint); }

.icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--text-faint);
}
.icon-btn:hover { background: var(--red-bg); color: var(--red); }

/* ---------- 补剂 ---------- */
.supp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.supp-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--card);
  transition: box-shadow 0.2s;
}
.supp-card:hover { box-shadow: var(--shadow-hover); }
.supp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.supp-icon { font-size: 24px; }
.supp-name { font-weight: 700; font-size: 15px; }
.supp-dose { font-size: 18px; font-weight: 700; color: var(--primary-dark); margin: 6px 0 2px; }
.supp-note { font-size: 12px; color: var(--text-light); }
.supp-check { margin-top: 10px; }

/* 打卡开关 */
.check-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.check-toggle input { display: none; }
.check-box {
  width: 22px; height: 22px;
  border-radius: 7px;
  border: 2px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s;
  background: var(--bg-soft);
}
.check-toggle input:checked + .check-box {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.check-label { font-size: 13px; color: var(--text-light); font-weight: 600; }
.check-toggle input:checked ~ .check-label { color: var(--green); }

/* ---------- 疫苗 ---------- */
.vacc-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.vacc-item:last-child { border-bottom: none; }
.vacc-name { font-weight: 600; }
.vacc-desc { font-size: 12px; color: var(--text-light); }
.vacc-age { font-size: 12px; color: var(--text-faint); white-space: nowrap; }

/* ---------- 图表容器 ---------- */
.chart-box { position: relative; height: 340px; margin-top: 8px; }
.chart-box-sm { position: relative; height: 220px; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--text-light); }
.chart-legend span { display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ---------- 统计条 ---------- */
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.stat-box {
  flex: 1;
  min-width: 140px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.stat-label { font-size: 12px; color: var(--text-light); }
.stat-value { font-size: 20px; font-weight: 700; color: var(--primary-dark); }
.stat-value small { font-size: 12px; color: var(--text-light); font-weight: 400; }

/* ---------- 分享 ---------- */
.share-link-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bg-soft);
  border: 1px dashed var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 8px;
}
.share-link-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--text);
  outline: none;
  font-family: inherit;
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(74, 68, 88, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(74,68,88,0.25);
  padding: 24px;
  width: 92%;
  max-width: 480px;
  max-height: 86vh;
  overflow-y: auto;
}
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  color: var(--text-faint);
  padding: 30px 0;
  font-size: 13px;
}
.empty-icon { font-size: 36px; display: block; margin-bottom: 8px; }

/* ---------- 提示 ---------- */
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--text);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: toast-in 0.25s ease;
  max-width: 320px;
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- 加载 ---------- */
.loading { text-align: center; padding: 40px; color: var(--text-faint); }
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 登录页 ---------- */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-hover);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-logo {
  width: 64px; height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  box-shadow: 0 4px 14px rgba(155,127,212,0.3);
}
.login-title { font-size: 20px; font-weight: 700; color: var(--text); }
.login-sub { font-size: 13px; color: var(--text-light); margin: 4px 0 24px; }
.login-card .form-group { text-align: left; }
.login-card input { width: 100%; padding: 10px 14px; }
.login-err { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* 侧边栏用户栏 */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--sidebar-hover);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  overflow: hidden;
}
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--primary-dark); overflow: hidden; text-overflow: ellipsis; }
.sidebar.collapsed .sidebar-user { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .user-name { display: none; }

/* ---------- 响应式 ---------- */
/* 平板 */
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .supp-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* 手机 */
@media (max-width: 768px) {
  /* 侧边栏在手机端完全隐藏,改用底部导航 */
  .sidebar, .sidebar-mask, .collapse-btn, .sidebar-footer { display: none !important; }
  .app { display: block; }

  /* 移动顶栏: 标题 + 年龄 */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 2px 12px;
  }
  .mobile-topbar-title { font-size: 16px; font-weight: 700; color: var(--text); }
  .mobile-topbar-age {
    font-size: 12px; color: var(--primary-dark);
    background: var(--sidebar); padding: 3px 10px; border-radius: 12px;
    white-space: nowrap;
  }

  .main { padding: 12px 12px calc(84px + env(safe-area-inset-bottom, 0)); max-width: 100%; }
  .page-title { font-size: 18px; flex-wrap: wrap; }
  .page-desc { font-size: 12px; }
  .page-age-tag { margin-left: 0; }

  /* 卡片与网格 */
  .dash-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .dash-card { padding: 12px; }
  .dash-value { font-size: 18px; }
  .baby-hero { padding: 16px; gap: 14px; }
  .baby-avatar { width: 52px; height: 52px; font-size: 26px; }
  .baby-name { font-size: 18px; }
  .age-pill { padding: 3px 10px; font-size: 12px; }
  .age-pill b { font-size: 14px; }

  /* 表单: 全宽堆叠,触控友好 */
  .form-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .form-group input, .form-group select, .form-group textarea {
    width: 100% !important;
    font-size: 16px;  /* 防止 iOS 聚焦缩放 */
    padding: 11px 12px;
    min-height: 44px;
  }
  .form-group input[type="number"],
  .form-group input[type="date"],
  .form-group input[type="time"] { width: 100% !important; }
  .btn { min-height: 44px; justify-content: center; }
  .btn-primary, .btn-soft { width: 100%; }
  .btn-ghost { width: auto; }

  /* 统计与图表 */
  .stat-row { gap: 10px; }
  .stat-box { min-width: calc(50% - 10px); padding: 10px 12px; }
  .stat-value { font-size: 18px; }
  .chart-box { height: 280px; }

  /* 表格横滚 */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  table { min-width: 520px; }

  /* 补剂 */
  .supp-grid { grid-template-columns: 1fr; gap: 10px; }

  /* 列表项 */
  .list-item { gap: 10px; }
  .item-icon { width: 30px; font-size: 20px; }

  /* 登录页 */
  .login-wrap { min-height: 82vh; padding: 20px 0; }
  .login-card { padding: 32px 22px; border-radius: 16px; }

  /* 照片网格: 2 列更紧凑 */
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .photo-card img { height: 130px; }

  /* ---------- 底部导航 ---------- */
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 80;
    background: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 16px rgba(74, 68, 88, 0.06);
  }
  .bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 7px 0 6px;
    min-height: 54px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 11px;
    -webkit-tap-highlight-color: transparent;
  }
  .bnav-item .bnav-icon { font-size: 21px; line-height: 1; }
  .bnav-item.active { color: var(--primary-dark); font-weight: 600; }

  /* ---------- 更多面板(底部弹出) ---------- */
  .more-mask {
    position: fixed; inset: 0;
    background: rgba(30, 24, 46, 0.45);
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 89;
  }
  .more-sheet.open .more-mask { opacity: 1; pointer-events: auto; }
  .more-panel {
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 90;
    background: #fff;
    border-radius: 18px 18px 0 0;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0));
    transform: translateY(100%);
    transition: transform 0.22s ease;
    box-shadow: 0 -6px 30px rgba(30, 24, 46, 0.15);
  }
  .more-sheet.open .more-panel { transform: translateY(0); }
  .more-title { font-size: 14px; font-weight: 700; color: var(--text); text-align: center; margin-bottom: 14px; }
  .more-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 6px; }
  .more-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    text-decoration: none; color: var(--text);
    padding: 8px 2px; border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
  }
  .more-item:active { background: var(--bg-soft); }
  .more-icon { font-size: 24px; }
  .more-label { font-size: 11px; color: var(--text-light); }
  .more-foot { margin-top: 14px; display: flex; justify-content: center; }
  .more-foot .btn { width: 60%; }
}

/* 桌面端隐藏移动顶栏 / 底部导航 / 更多面板 */
@media (min-width: 769px) {
  .mobile-topbar { display: none !important; }
  .bottom-nav { display: none !important; }
  .more-sheet { display: none !important; }
  .sidebar-mask { display: none !important; }
}


.mobile-topbar { display: none; }
@media (min-width: 769px) {
  .mobile-topbar { display: none !important; }
  .sidebar-mask { display: none !important; }
}


/* ===== 照片记录页 ===== */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.photo-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(109, 91, 143, 0.12);
  box-shadow: 0 2px 10px rgba(109, 91, 143, 0.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.photo-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(109, 91, 143, 0.14); }
.photo-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: #f3eef8;
}
.photo-info { padding: 10px 12px 12px; }
.photo-date { font-size: 12px; color: #8a7fa3; }
.photo-note { font-size: 13px; color: #4a3f5c; margin-top: 2px; min-height: 18px; word-break: break-all; }


/* ===== 照片页: 月份筛选 + 灯箱/幻灯 ===== */
.month-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.month-chip {
  padding: 5px 14px;
  border-radius: 14px;
  border: 1px solid rgba(109, 91, 143, 0.25);
  background: #fff;
  color: #6d5b8f;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
}
.month-chip:hover { border-color: #6d5b8f; }
.month-chip.active { background: #6d5b8f; color: #fff; border-color: #6d5b8f; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 32, 0.88);
}
.lightbox-stage {
  position: relative;
  z-index: 2;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-stage img {
  max-width: 92vw;
  max-height: 74vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  background: #1c1626;
}
.lightbox-caption {
  color: #e8e2f3;
  margin-top: 10px;
  font-size: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.lightbox-count { color: #b3a7c9; font-size: 13px; }
.lightbox-play {
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 5px 16px;
  cursor: pointer;
  font-size: 13px;
}
.lightbox-play:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.3); }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-close {
  position: absolute;
  top: 12px;
  right: 18px;
  z-index: 3;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

/* ---------- 喂养:按天/按月切换 ---------- */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg-btn { border: none; background: transparent; padding: 7px 14px; font-size: 13px; cursor: pointer; color: var(--text-light); transition: background .15s, color .15s; }
.seg-btn:hover { background: var(--sidebar-hover); }
.seg-btn.active { background: var(--primary); color: #fff; }
.nav-btn { padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; }
.nav-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.period-label { font-size: 13px; font-weight: 700; color: var(--primary-dark); margin-left: auto; }

/* 按月视图:按天分组 */
.day-group { margin-bottom: 6px; }
.day-group-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--primary-dark); padding: 6px 0 2px; border-bottom: 1px dashed var(--border); margin-bottom: 4px; }
.day-group-count { font-weight: 400; color: var(--text-faint); font-size: 11px; }
