/* ==================== CSS 变量 ==================== */
:root {
  --primary: #E8839E;
  --primary-light: #F2A5BC;
  --primary-dark: #C96580;
  --primary-bg: #FDEEF2;

  --sleep: #9B8EC4;
  --sleep-light: #C3B8E0;
  --feeding: #F2A091;
  --feeding-light: #F8C7BC;
  --diaper: #F5C97D;
  --diaper-light: #FBE3B0;
  --activity: #88C4A0;
  --activity-light: #B5DEC4;
  --outing: #7BB5D6;
  --play: #5AAE6E;
  --outing-light: #A8CDE4;

  --bg: #FDF4F6;
  --card-bg: #FFFFFF;
  --text: #3D2D32;
  --text-secondary: #8A7079;
  --text-light: #C4AAB1;
  --border: #F5E0E6;
  --danger: #E8768A;
  --success: #7EC4A0;
  --warning: #F2B86D;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 2px 12px rgba(232,131,158,0.06);
  --shadow-md: 0 4px 20px rgba(232,131,158,0.08);
  --shadow-lg: 0 8px 36px rgba(232,131,158,0.12);
  --header-h: 60px;
  --nav-h: 64px;
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

input, button, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ==================== 初始设置页面 ==================== */
.setup-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 20px;
}

.setup-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.setup-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
}

.setup-card h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.setup-subtitle {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 14px;
}

.setup-form { text-align: left; }

/* ==================== 表单 ==================== */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="number"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 16px;
  transition: border-color 0.2s;
  background: var(--bg);
}
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.gender-select {
  display: flex;
  gap: 12px;
}
.gender-btn {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  font-size: 15px;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.gender-btn.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-weight: 600;
}

/* ==================== 按钮 ==================== */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; }

.btn-secondary {
  flex: 1;
  padding: 10px 16px;
  background: var(--primary-bg);
  color: var(--primary-dark);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-danger {
  flex: 1;
  padding: 10px 16px;
  background: #FDEAEF;
  color: var(--danger);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-add {
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==================== 主应用布局 ==================== */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
  padding-bottom: calc(var(--nav-h) + 16px);
}

/* ==================== 顶部栏 ==================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: var(--shadow-sm);
}

.header-left { display: flex; align-items: center; gap: 10px; }

.baby-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.baby-avatar svg {
  width: 100%;
  height: 100%;
}

.baby-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-edit-badge {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.header-info { line-height: 1.3; }
.header-name { font-size: 16px; font-weight: 700; }
.header-age { font-size: 12px; color: var(--text-secondary); }

.header-settings {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 18px;
}

/* ==================== 页面 ==================== */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-content { padding: 16px; }

/* ==================== 备案信息 ==================== */
.icp-footer {
  text-align: center;
  padding: 22px 0 10px;
  font-size: 11.5px;
  line-height: 1.6;
}

.icp-footer a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s ease;
}

.icp-footer a:hover { color: var(--text-secondary); }

/* ==================== 宝宝成长卡 ==================== */
.baby-growth-card {
  background: linear-gradient(135deg, #FFF0F4, #FDE3EA);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #FAD3DE;
}

.bgc-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.baby-avatar.lg {
  width: 48px;
  height: 48px;
}

.bgc-info { flex: 1; min-width: 0; }
.bgc-name { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.bgc-age { font-size: 12px; color: var(--text-secondary); }

.bgc-day-badge {
  min-width: 62px;
  padding: 7px 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, #F58BA4, #E26D8E);
  color: #fff;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-shadow: 0 4px 14px rgba(232,131,158,0.38);
}

.bgc-day-num {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.bgc-day-label {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.92;
}

.bgc-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(255,255,255,0.75);
  border-radius: var(--radius-md);
  padding: 8px 10px;
}

.bgc-tip-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #fff;
  color: #F2A091;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  box-shadow: 0 2px 6px rgba(232,131,158,0.18);
}

.bgc-tip-text {
  flex: 1;
  font-size: 12px;
  color: var(--text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== 更换头像弹窗 ==================== */
.avatar-section-title {
  font-size: 13px;
  color: var(--text-light);
  margin: 4px 0 12px;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.avatar-preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.avatar-preset svg,
.avatar-preset img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-preset.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.avatar-preset-name { font-size: 11px; color: var(--text-light); }

.avatar-upload-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px dashed var(--primary);
  cursor: pointer;
}

/* ==================== 记录人徽章（header） ==================== */
.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 8px;
  background: var(--primary-bg);
  border-radius: 20px;
  padding: 3px 10px 3px 3px;
  cursor: pointer;
  border: 1px solid #F8D7E0;
  flex-shrink: 0;
}

.user-chip-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.user-chip-avatar svg { width: 100%; height: 100%; }
.user-chip-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-chip-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-dark);
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==================== 登录（选择记录人）弹窗 ==================== */
.login-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 26px 22px 20px;
  width: 320px;
  max-width: 88vw;
  text-align: center;
  animation: popIn 0.22s ease;
  box-shadow: var(--shadow-lg);
  max-height: 86vh;
  overflow-y: auto;
}

.login-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.login-sub { font-size: 12px; color: var(--text-light); margin-bottom: 16px; }

.login-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.login-avatar-grid .avatar-preset { padding: 6px 2px; }
.login-avatar-grid .avatar-preset svg { width: 46px; height: 46px; }

.login-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  text-align: center;
  outline: none;
  background: var(--bg);
  box-sizing: border-box;
  margin-bottom: 14px;
}

.login-input:focus { border-color: var(--primary); }

.login-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(232,131,158,0.3);
}

.login-users {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.login-users-title { font-size: 12px; color: var(--text-light); margin-bottom: 10px; }
.login-users-list { display: flex; flex-direction: column; gap: 8px; }

.login-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--bg);
  cursor: pointer;
  font-size: 14px;
}

.login-user-item.active { background: var(--primary-bg); color: var(--primary-dark); }
.login-user-item .fa-check { margin-left: auto; color: var(--primary); }

.login-user-avatar,
.user-list-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  flex-shrink: 0;
}

.login-user-avatar svg,
.user-list-avatar svg { width: 100%; height: 100%; }
.login-user-avatar img,
.user-list-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ==================== 切换记录人弹窗 ==================== */
.user-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.user-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg);
  cursor: pointer;
  border: 1.5px solid transparent;
}

.user-list-item.active { border-color: var(--primary); background: var(--primary-bg); }
.user-list-name { flex: 1; font-size: 15px; font-weight: 500; }

.user-list-tag {
  font-size: 11px;
  color: var(--primary);
  background: #fff;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 600;
}

.user-empty { text-align: center; color: var(--text-light); padding: 24px 0; font-size: 13px; }

.user-add-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px dashed var(--primary);
  cursor: pointer;
}

/* ==================== 记录人标签（时间线） ==================== */
.tl-recorder {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-size: 11px;
  border-radius: 12px;
  padding: 1px 8px 1px 2px;
  margin-left: 4px;
  vertical-align: middle;
}

.tl-recorder svg {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tl-recorder img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ==================== 今日概览 ==================== */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.summary-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s;
}
.summary-card:active { transform: scale(0.97); }

.summary-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}
.summary-icon.sleep { background: var(--sleep); }
.summary-icon.feeding { background: var(--feeding); }
.summary-icon.diaper { background: var(--diaper); }
.summary-icon.activity { background: var(--activity); }

.summary-value { font-size: 17px; font-weight: 700; }
.summary-label { font-size: 11px; color: var(--text-secondary); }
/* 喂养卡片：次数后的"上次喂养距今"小字 */
.summary-value .summary-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: 3px;
  white-space: nowrap;
}

/* 换尿布卡片：上次小便 / 大便距今（单行紧凑） */
.diaper-elapsed {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  line-height: 1.2;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
}
.de-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.de-tag {
  font-weight: 800;
  font-size: 10px;
  line-height: 1;
}
.de-tag.pee { color: #5A9CC5; }
.de-tag.poop { color: #B08968; }

/* ==================== 参考提示 ==================== */
.reference-tip {
  background: linear-gradient(135deg, #FFF0F4, #FDE6ED);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--primary-dark);
  line-height: 1.5;
}
.reference-tip i { color: var(--primary); margin-top: 2px; }

/* ==================== 区块标题 ==================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  margin-top: 8px;
}
.section-header h3 {
  font-size: 17px;
  font-weight: 700;
}
.section-date { font-size: 13px; color: var(--text-secondary); }

/* ==================== 时间线 ==================== */
.timeline { list-style: none; }

.timeline-item {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.timeline-item:active { background: var(--primary-bg); }
.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.timeline-item.sleep::before { background: var(--sleep); }
.timeline-item.feeding::before { background: var(--feeding); }
.timeline-item.diaper::before { background: var(--diaper); }
.timeline-item.activity::before { background: var(--activity); }
.timeline-item.outing::before { background: var(--outing); }
.timeline-item.play::before { background: var(--play); }

.tl-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}
.tl-icon.sleep { background: var(--sleep); }
.tl-icon.feeding { background: var(--feeding); }
.tl-icon.diaper { background: var(--diaper); }
.tl-icon.activity { background: var(--activity); }
.tl-icon.outing { background: var(--outing); }
.tl-icon.play { background: var(--play); }

.tl-content { flex: 1; min-width: 0; }
.tl-title { font-size: 14px; font-weight: 600; }
.tl-detail { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.tl-time { font-size: 12px; color: var(--text-light); flex-shrink: 0; }

.tl-delete {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.tl-delete:active { color: var(--danger); }

/* ==================== 空状态 ==================== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; }

/* ==================== 底部导航 ==================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-h);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -2px 16px rgba(232,131,158,0.06);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-light);
  font-size: 11px;
  height: 100%;
  justify-content: center;
  padding-top: 8px;
}
.nav-btn i { font-size: 20px; }
.nav-btn.active { color: var(--primary); }

.nav-fab {
  flex: 0 0 auto;
  padding-top: 0;
}
.fab-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(232,131,158,0.35);
  margin-top: -20px;
}

/* ==================== 遮罩层 ==================== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(61,45,50,0.35);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

/* ==================== 简洁确认弹窗 ==================== */
.confirm-overlay {
  align-items: center;
}

.confirm-box {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 26px 22px 18px;
  width: 280px;
  max-width: 80vw;
  text-align: center;
  animation: popIn 0.22s ease;
  box-shadow: var(--shadow-lg);
}

@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.confirm-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #FDEAEF;
  color: var(--danger);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-text {
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 20px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.confirm-btn.cancel {
  background: var(--bg);
  color: var(--text-light);
}

.confirm-btn.ok {
  background: var(--danger);
  color: #fff;
}

/* ---------- 提示型确认（如「重复记录」）---------- */
.confirm-box.wide { width: 310px; }

.confirm-icon.primary {
  background: var(--primary-bg);
  color: var(--primary);
}

.confirm-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.confirm-meta {
  align-items: center;
  gap: 5px;
  margin: 0 auto 12px;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.2;
}

.confirm-meta i { font-size: 11px; color: var(--text-light); }

.confirm-text.sub {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.confirm-btn.ok.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(232,131,158,0.32);
}

/* ==================== 底部弹窗 ==================== */
.bottom-sheet {
  background: var(--card-bg);
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 10px auto;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 12px;
  border-bottom: 1px solid var(--border);
}
.sheet-header.sticky {
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 10;
}
.sheet-header h3 { font-size: 17px; font-weight: 700; }
.sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
}

.sheet-body { padding: 20px; }

/* ==================== 记录表单 ==================== */
.record-form-group { margin-bottom: 18px; }
.record-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.record-form-group input[type="time"],
.record-form-group input[type="date"],
.record-form-group input[type="number"],
.record-form-group input[type="text"],
.record-form-group select,
.record-form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 16px;
  background: var(--bg);
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

/* iOS/安卓时间输入框优化 */
.record-form-group input[type="time"] {
  min-height: 46px;
  line-height: 1.2;
}
.record-form-group input[type="time"]::-webkit-date-and-time-value {
  text-align: left;
}
.record-form-group input:focus,
.record-form-group select:focus,
.record-form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.option-btn {
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.option-btn.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-weight: 600;
}

.time-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
}
.time-inputs input { flex: 1; }
.time-inputs span { color: var(--text-light); }

/* 时间输入框（原生 time 选择器 + 上午/下午徽标） */
.time-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.time-input-wrap input[type="time"] {
  flex: 1;
  min-width: 0;
}

.ampm-badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}

.ampm-badge.am {
  background: #FFF3E0;
  color: #E8833A;
}

.ampm-badge.pm {
  background: #E3F2FD;
  color: #4A7FB5;
}

.tp-sep {
  flex-shrink: 0;
}

/* ==================== 快速倒退时间按钮 ==================== */
.quick-back-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.qbr-label {
  font-size: 11px;
  color: var(--text-light);
  margin-right: 2px;
}

.qbt-btn {
  padding: 5px 12px;
  border-radius: 14px;
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #F8D7E0;
  cursor: pointer;
  transition: transform 0.12s;
}

.qbt-btn:active { transform: scale(0.92); }

.qbt-btn.now {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.qbt-btn.clear {
  background: #fff;
  color: var(--danger);
}

.duration-display {
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--primary-dark);
  font-weight: 600;
  margin-top: 8px;
  text-align: center;
}

/* ==================== 快捷添加菜单 ==================== */
.quick-add-menu {
  background: var(--card-bg);
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px;
  animation: slideUp 0.3s ease;
}
.quick-add-menu button {
  width: 100%;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  color: var(--text);
  transition: background 0.15s;
}
.quick-add-menu button:last-child { border-bottom: none; }
.quick-add-menu button:active { background: var(--bg); }
.qa-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}
.qa-icon.sleep { background: var(--sleep); }
.qa-icon.feeding { background: var(--feeding); }
.qa-icon.diaper { background: var(--diaper); }
.qa-icon.activity { background: var(--activity); }

/* ==================== 统计图表 ==================== */
.range-tabs {
  display: flex;
  gap: 6px;
  background: var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.range-btn {
  padding: 5px 14px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.range-btn.active {
  background: var(--card-bg);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.chart-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.chart-wrap {
  position: relative;
  height: 160px;
  width: 100%;
}
.chart-wrap.tall {
  height: 200px;
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.chart-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.chart-avg { font-size: 12px; color: var(--text-secondary); }

.metric-tabs {
  display: flex;
  gap: 4px;
  background: var(--border);
  border-radius: 10px;
  padding: 2px;
}
.metric-btn {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
.metric-btn.active {
  background: var(--card-bg);
  color: var(--primary);
  font-weight: 600;
}

.chart-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.legend-dot.who { background: var(--primary-light); }
.legend-dot.baby { background: var(--feeding); }

/* ==================== 成长页面 ==================== */
.growth-overview {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.growth-card {
  flex: 1;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.growth-icon {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 6px;
}
.growth-value { font-size: 18px; font-weight: 700; }
.growth-label { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.growth-percentile {
  font-size: 10px;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 8px;
  display: inline-block;
}
.growth-percentile.normal { background: #E8F8F0; color: var(--success); }
.growth-percentile.warn { background: #FFF6E6; color: var(--warning); }
.growth-percentile.danger { background: #FDEAEF; color: var(--danger); }

/* 里程碑进度 */
.milestone-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.milestone-item {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.milestone-month {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  text-align: center;
  line-height: 1.1;
}
.milestone-month.achieved { background: #E8F8F0; color: var(--success); }
.milestone-month.current { background: var(--primary-bg); color: var(--primary-dark); }
.milestone-month.future { background: var(--bg); color: var(--text-light); }

.milestone-info { flex: 1; }
.milestone-title { font-size: 14px; font-weight: 600; }
.milestone-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.milestone-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 8px;
  flex-shrink: 0;
}
.milestone-status.achieved { background: #E8F8F0; color: var(--success); }
.milestone-status.current { background: var(--primary-bg); color: var(--primary-dark); }
.milestone-status.future { color: var(--text-light); }

/* 生长记录历史 */
.growth-history { display: flex; flex-direction: column; gap: 8px; }
.growth-history-item {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.gh-date { font-size: 14px; font-weight: 600; }
.gh-data { font-size: 13px; color: var(--text-secondary); display: flex; gap: 12px; }
.gh-data span { display: flex; align-items: center; gap: 4px; }
.gh-delete {
  color: var(--text-light);
  font-size: 16px;
  padding: 4px 8px;
}

/* ==================== 工具类 ==================== */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}
.data-actions { display: flex; gap: 10px; align-items: center; }

/* ==================== 云同步 ==================== */
.sync-section {
  background: #F4F9FD;
  border: 1px solid #D9EBF7;
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 4px;
}

.sync-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sync-header label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0;
}

.sync-header label i { color: #4A90D9; }

.sync-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 10px;
  flex-shrink: 0;
}

.sync-status.off { background: var(--bg); color: var(--text-light); }
.sync-status.connecting { background: #FFF4E6; color: #E67E22; }
.sync-status.on { background: #E8F6EF; color: #27AE60; }

.sync-hint {
  font-size: 11px;
  color: var(--text-light);
  margin: 6px 0 10px;
  line-height: 1.4;
}

.sync-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-input-row input {
  flex: 1;
  min-width: 0;
  width: auto;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  outline: none;
  background: var(--bg);
  box-sizing: border-box;
}

.sync-input-row input:focus { border-color: #4A90D9; }
.sync-input-row input:disabled { opacity: 0.5; }

.sync-btn {
  flex-shrink: 0;
  width: auto !important;
  padding: 10px 16px;
}

.sync-last {
  font-size: 11px;
  color: var(--text-light);
}

/* ==================== 响应式 ==================== */
@media (min-width: 481px) {
  body { background: #F0E4E8; }
  .app {
    box-shadow: 0 0 40px rgba(232,131,158,0.08);
  }
}

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ==================== 每日打卡 ==================== */
.daily-checklist {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.checklist-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.checklist-title i { color: var(--primary); }

.checklist-items {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.checklist-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  min-width: 0;
  transition: all 0.2s;
  position: relative;
}
.checklist-item .check-circle {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #fff;
  opacity: 0;
  transition: all 0.2s;
}
.checklist-item .check-icon {
  font-size: 18px;
  color: var(--text-light);
  transition: color 0.2s;
}
.checklist-item span {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.checklist-item.checked {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.checklist-item.checked .check-circle {
  background: var(--success);
  opacity: 1;
}
.checklist-item.checked .check-icon {
  color: var(--primary);
}
.checklist-item.checked span {
  color: var(--primary-dark);
  font-weight: 600;
}

/* ==================== 异常状态追踪 ==================== */
.abnormal-section {
  margin-bottom: 20px;
}
.abnormal-section .section-header h3 {
  display: flex;
  align-items: center;
  gap: 6px;
}
.abnormal-section .section-header h3 i {
  color: var(--danger);
}

.abnormal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-state-sm {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: #E8F8F0;
  border-radius: var(--radius-md);
  color: var(--success);
  font-size: 14px;
  font-weight: 500;
}
.empty-state-sm i { font-size: 18px; }

.abnormal-item {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s;
  border-left: 4px solid var(--warning);
}
.abnormal-item:active { transform: scale(0.98); }

.ab-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.ab-item-content { flex: 1; min-width: 0; }
.ab-item-title { font-size: 14px; font-weight: 600; }
.ab-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-secondary);
}
.ab-item-arrow { color: var(--text-light); font-size: 12px; }

.ab-severity-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
}

/* ==================== 异常类型选择网格 ==================== */
.abnormal-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ab-type-btn {
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.ab-type-btn i { font-size: 18px; }
.ab-type-btn.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-weight: 600;
}
.ab-type-btn.active i { color: var(--primary); }

/* ==================== 异常详情 ==================== */
.ab-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.ab-detail-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.ab-detail-title { font-size: 18px; font-weight: 700; }
.ab-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.ab-detail-section { margin-bottom: 20px; }
.ab-detail-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.ab-detail-desc {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
}

.ab-updates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ab-update-item {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.ab-update-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ab-update-time { font-size: 12px; color: var(--text-light); }
.ab-update-content { font-size: 14px; line-height: 1.5; }
.ab-no-updates {
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  padding: 16px;
}

.ab-action-btns {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.ab-action-btns .btn-secondary,
.ab-action-btns .btn-resolve {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-resolve {
  background: #E8F8F0;
  color: var(--success);
}

/* ==================== 快捷添加图标扩展 ==================== */
.qa-icon.supplement { background: #B98EC4; }
.qa-icon.abnormal { background: var(--danger); }

/* ==================== textarea 样式 ==================== */
.record-form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--bg);
  resize: none;
  font-family: inherit;
  transition: border-color 0.2s;
}
.record-form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* ==================== 睡眠状态大按钮 ==================== */
.sleep-toggle-card {
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.15s;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.sleep-toggle-card:active { transform: scale(0.98); }

.sleep-toggle-card.awake {
  background: linear-gradient(135deg, #F5C97D, #F0A87A);
}
.sleep-toggle-card.sleeping {
  background: linear-gradient(135deg, #9B8EC4, #7B6DAA);
  animation: sleepPulse 3s ease-in-out infinite;
}

@keyframes sleepPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(155,142,196,0.25); }
  50% { box-shadow: 0 4px 24px rgba(155,142,196,0.4); }
}

.sleep-toggle-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
}

.sleep-toggle-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: #fff;
  flex-shrink: 0;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(4px);
}

.sleep-toggle-card.awake .sleep-toggle-icon {
  animation: sunRotate 8s linear infinite;
}
@keyframes sunRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sleep-toggle-card.sleeping .sleep-toggle-icon {
  animation: moonFloat 2s ease-in-out infinite alternate;
}
@keyframes moonFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}

.sleep-toggle-text { flex: 1; min-width: 0; }

.sleep-toggle-state {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.sleep-toggle-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  margin-top: 3px;
  font-weight: 500;
}

.sleep-toggle-arrow {
  color: rgba(255,255,255,0.6);
  font-size: 16px;
  flex-shrink: 0;
}

/* ==================== 外出状态大按钮 ==================== */
.outing-toggle-card {
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 14px;
  cursor: pointer;
  transition: transform 0.15s;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.outing-toggle-card:active { transform: scale(0.98); }

.outing-toggle-card.home {
  background: linear-gradient(135deg, #A8CDE4, #7BB5D6);
}
.outing-toggle-card.outing {
  background: linear-gradient(135deg, #7BB5D6, #5A9CC5);
  animation: outingPulse 3s ease-in-out infinite;
}

@keyframes outingPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(123,181,214,0.25); }
  50% { box-shadow: 0 4px 24px rgba(123,181,214,0.4); }
}

.outing-toggle-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
}

.outing-toggle-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: #fff;
  flex-shrink: 0;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(4px);
}

.outing-toggle-card.home .outing-toggle-icon {
  animation: houseBounce 2s ease-in-out infinite alternate;
}
@keyframes houseBounce {
  from { transform: translateY(0); }
  to { transform: translateY(-3px); }
}

.outing-toggle-card.outing .outing-toggle-icon {
  animation: treeSway 2.5s ease-in-out infinite alternate;
}
@keyframes treeSway {
  from { transform: rotate(-3deg); }
  to { transform: rotate(3deg); }
}

.outing-toggle-text { flex: 1; min-width: 0; }

.outing-toggle-state {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.outing-toggle-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  margin-top: 3px;
  font-weight: 500;
}

.outing-toggle-arrow {
  color: rgba(255,255,255,0.6);
  font-size: 16px;
  flex-shrink: 0;
}

/* ==================== 玩耍状态大按钮（成长绿） ==================== */
.play-toggle-card {
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 14px;
  cursor: pointer;
  transition: transform 0.15s;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.play-toggle-card:active { transform: scale(0.98); }

.play-toggle-card.idle {
  background: linear-gradient(135deg, #A6D9A6, #74C083);
}
.play-toggle-card.companion {
  background: linear-gradient(135deg, #86CE93, #469E63);
  animation: playPulse 3s ease-in-out infinite;
}
.play-toggle-card.independent {
  background: linear-gradient(135deg, #B9DFAF, #8DC98C);
}

@keyframes playPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(70,158,99,0.22); }
  50% { box-shadow: 0 4px 24px rgba(70,158,99,0.38); }
}

.play-toggle-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
}

.play-toggle-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: #fff;
  flex-shrink: 0;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(4px);
}

.play-toggle-card.idle .play-toggle-icon {
  animation: playFloat 2.4s ease-in-out infinite alternate;
}
@keyframes playFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-3px); }
}

.play-toggle-card.companion .play-toggle-icon {
  animation: playBounce 1.6s ease-in-out infinite;
}
@keyframes playBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.play-toggle-card.independent .play-toggle-icon {
  animation: playSway 3s ease-in-out infinite alternate;
}
@keyframes playSway {
  from { transform: rotate(-4deg); }
  to { transform: rotate(4deg); }
}

.play-toggle-text { flex: 1; min-width: 0; }

.play-toggle-state {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.play-toggle-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.88);
  margin-top: 3px;
  font-weight: 500;
}

.play-toggle-arrow {
  color: rgba(255,255,255,0.6);
  font-size: 16px;
  flex-shrink: 0;
}

/* ==================== 睡眠切换弹窗内样式 ==================== */
.sleep-toggle-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--primary-bg);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--primary-dark);
  font-weight: 500;
}
.sleep-toggle-info i { font-size: 18px; }

.sleep-summary-box {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}

.sleep-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.sleep-summary-row:last-child { border-bottom: none; }

.sleep-summary-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.sleep-summary-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.sleep-summary-value.highlight {
  color: var(--sleep);
  font-size: 17px;
}
.sleep-summary-value input[type="time"] {
  width: auto;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 15px;
  font-weight: 700;
  background: var(--card-bg);
}

/* ==================== 睡眠记录弹窗状态横幅 ==================== */
.sleep-state-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--sleep), var(--sleep-light));
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  cursor: pointer;
  transition: transform 0.15s;
}
.sleep-state-banner:active { transform: scale(0.98); }
.sleep-state-banner i { color: #fff; font-size: 16px; }
.sleep-state-banner i:last-child { margin-left: auto; font-size: 12px; }
.sleep-state-banner span {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  flex: 1;
}

/* ==================== 疫苗模块 ==================== */

/* 下一针提醒卡 */
.vac-next-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.15s;
}
.vac-next-card:active { transform: scale(0.98); }
.vac-next-card.due {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}
.vac-next-card.upcoming {
  background: var(--card-bg);
  border: 2px solid var(--border);
}
.vac-next-card.all-done {
  background: #E8F8F0;
  border: 2px solid #C8EED8;
}

.vac-next-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.vac-next-card.due .vac-next-icon {
  background: rgba(255,255,255,0.25);
  color: #fff;
}
.vac-next-card.upcoming .vac-next-icon {
  background: var(--primary-bg);
  color: var(--primary);
}
.vac-next-card.all-done .vac-next-icon {
  background: #D5F0E0;
  color: var(--success);
}

.vac-next-text { flex: 1; min-width: 0; }
.vac-next-title {
  font-size: 16px;
  font-weight: 700;
}
.vac-next-card.due .vac-next-title { color: #fff; }
.vac-next-sub {
  font-size: 13px;
  margin-top: 3px;
  font-weight: 500;
}
.vac-next-card.due .vac-next-sub { color: rgba(255,255,255,0.85); }
.vac-next-card.upcoming .vac-next-sub { color: var(--text-secondary); }
.vac-next-card.all-done .vac-next-sub { color: var(--success); }
.vac-next-card.all-done .vac-next-title { color: var(--success); }

.vac-next-action {
  font-size: 24px;
  flex-shrink: 0;
}
.vac-next-card.due .vac-next-action { color: #fff; }
.vac-next-card.upcoming .vac-next-action { color: var(--text-light); }

/* 自费疫苗选择卡 */
.vaccine-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.vac-choice-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  cursor: pointer;
}
.vac-choice-card:active { transform: scale(0.98); }
.vac-choice-card.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.vac-choice-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vac-choice-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.vac-choice-info { flex: 1; min-width: 0; }
.vac-choice-name { font-size: 15px; font-weight: 700; }
.vac-choice-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.vac-choice-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
  flex-shrink: 0;
}
.vac-choice-check.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.vac-choice-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

.vac-choice-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-weight: 500;
}

/* 筛选标签 */
.vaccine-filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--border);
  border-radius: 10px;
  padding: 2px;
}
.vfilter-btn {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.vfilter-btn.active {
  background: var(--card-bg);
  color: var(--primary);
  font-weight: 600;
}

/* 疫苗时间线 */
.vaccine-timeline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 20px;
}

.vac-month-group {
  position: relative;
  padding-left: 0;
}

.vac-month-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  position: relative;
}
.vac-month-label .vac-month-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--card-bg);
  box-shadow: 0 0 0 2px var(--border);
  flex-shrink: 0;
}
.vac-month-label.past .vac-month-dot {
  background: var(--text-light);
  box-shadow: 0 0 0 2px var(--text-light);
}
.vac-month-label.current {
  color: var(--primary);
}
.vac-month-label.current .vac-month-dot {
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
  animation: vacPulse 2s ease-in-out infinite;
}
@keyframes vacPulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--primary), 0 0 0 6px rgba(232,131,158,0.15); }
  50% { box-shadow: 0 0 0 2px var(--primary), 0 0 0 10px rgba(232,131,158,0.05); }
}

.vac-month-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 18px;
  border-left: 2px solid var(--border);
  margin-left: 4px;
  padding-bottom: 4px;
}

.vac-item {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
  margin-left: 8px;
}
.vac-item[onclick] { cursor: pointer; }
.vac-item[onclick]:active { transform: scale(0.98); }

.vac-item.done {
  opacity: 0.75;
}
.vac-item.pending, .vac-item.replaced_pending {
  border-left: 3px solid var(--primary);
}
.vac-item.not_selected, .vac-item.upcoming {
  opacity: 0.6;
}

.vac-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.vac-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.vac-item-info { min-width: 0; }
.vac-item-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vac-item-dose {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vac-item-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}

/* 疫苗接种弹窗 */
.vac-sheet-info {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.vac-sheet-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.vac-sheet-info-row:last-child { border-bottom: none; }
.vac-sheet-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
}
.vac-sheet-value {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  color: var(--text);
}

/* 疫苗详情弹窗 */
.vac-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.vac-detail-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  background: var(--primary-bg);
  color: var(--primary);
}
.vac-detail-title { font-size: 18px; font-weight: 700; }
.vac-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}
.vac-detail-date { font-weight: 600; }

/* ==================== 日历组件 ==================== */
.calendar-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 14px;
  transition: all 0.15s;
}
.cal-nav-btn:active { background: var(--bg); transform: scale(0.92); }

.cal-month-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 6px;
}
.calendar-weekdays span {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 600;
  padding: 4px 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 10px;
  position: relative;
  transition: background 0.15s;
  cursor: pointer;
}
.cal-cell:active { background: var(--bg); }
.cal-cell.empty { cursor: default; }
.cal-cell.empty:active { background: none; }

.cal-day-num {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
}

.cal-cell.today {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}
.cal-cell.today .cal-day-num {
  color: #fff;
  font-weight: 800;
}

.cal-cell.future {
  opacity: 0.35;
  cursor: default;
}
.cal-cell.future:active { background: none; }

.cal-cell.before-birth {
  opacity: 0.2;
  cursor: default;
}
.cal-cell.before-birth:active { background: none; }

.cal-dots {
  display: flex;
  gap: 2px;
  height: 4px;
  align-items: center;
}
.cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}
.cal-cell.today .cal-dot {
  background: rgba(255,255,255,0.8) !important;
}

.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.cal-leg-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}
.cal-leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ==================== 日历日期详情 ==================== */
.day-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.day-detail-stat {
  text-align: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
}
.dd-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 4px;
  font-size: 14px;
  color: #fff;
}
.dd-stat-icon.sleep { background: var(--sleep); }
.dd-stat-icon.feeding { background: var(--feeding); }
.dd-stat-icon.diaper { background: var(--diaper); }
.dd-stat-icon.activity { background: var(--activity); }
.dd-stat-val { font-size: 16px; font-weight: 700; }
.dd-stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }

.day-detail-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.dd-check-item {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.day-detail-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==================== 打卡统计卡片 ==================== */
.checklist-stats-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.cs-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.cs-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cs-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.cs-info {
  flex: 1;
  min-width: 0;
}
.cs-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 3px;
}
.cs-bar {
  height: 5px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.cs-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.cs-count {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  min-width: 38px;
  text-align: right;
  flex-shrink: 0;
}

/* 日历打卡标记 */
.cal-check-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-cell.today .cal-check-badge {
  background: rgba(255,255,255,0.9);
  color: var(--primary);
}
.cal-leg-check {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==================== 补录历史数据 ==================== */
.backfill-section {
  margin-top: 16px;
}
.backfill-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.backfill-section-title i {
  color: var(--primary);
  font-size: 13px;
}
.backfill-record-btns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.bf-record-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}
.bf-record-btn:active {
  transform: scale(0.96);
  border-color: var(--primary-light);
}
.bf-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.bf-icon.sleep { background: var(--sleep-light); color: var(--sleep); }
.bf-icon.feeding { background: var(--feeding-light); color: var(--feeding); }
.bf-icon.diaper { background: var(--diaper-light); color: #C9A84A; }
.bf-icon.activity { background: var(--activity-light); color: var(--activity); }
.backfill-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bf-check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}
.bf-check-item.checked {
  background: var(--primary-bg);
  border-color: var(--primary-light);
}
.bf-check-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: transparent;
  transition: all 0.2s;
}
.bf-check-item.checked .bf-check-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.bf-check-icon {
  font-size: 14px;
}

/* 日历日期详情 - 补录区 */
.day-detail-backfill {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.dd-backfill-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.dd-backfill-btns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.dd-bf-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  background: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.dd-bf-btn:active {
  transform: scale(0.96);
}
.dd-bf-btn i {
  font-size: 16px;
  color: var(--primary);
}
.dd-backfill-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dd-bf-check {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}
.dd-bf-check.checked {
  background: var(--primary-bg);
  border-color: var(--primary-light);
}
.dd-bf-check-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: transparent;
  transition: all 0.2s;
}
.dd-bf-check.checked .dd-bf-check-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
