/* ============================================
   BBKaihori · 治愈系马卡龙设计系统
   调色板：#C3C6E6 / #F0D8EB / #E4EFFF / #FFEAF3 / #FFFFFF
   ============================================ */

:root {
  /* 主色（柔和紫罗兰） */
  --primary: #A89FCD;
  --primary-light: #C3C6E6;
  --primary-dark: #8E83C2;
  --accent: #FFEAF3;
  --accent-2: #F0D8EB;
  --accent-3: #E4EFFF;
  --accent-4: #D6C8F0;

  /* 背景渐变（梦幻粉紫蓝） */
  --gradient-bg: linear-gradient(155deg,
    #FFEAF3 0%,
    #F0D8EB 25%,
    #E4EFFF 65%,
    #C3C6E6 100%);
  --gradient-card: linear-gradient(145deg,
    rgba(255,255,255,0.92),
    rgba(255, 234, 243, 0.55));

  /* 文字（柔和紫调，非纯黑） */
  --text-primary: #5A5775;
  --text-secondary: #9892B5;
  --text-light: #C9C5DD;

  /* 功能色 */
  --success: #9BC8B0;
  --warning: #E5B8C8;
  --danger: #D699A3;

  /* 阴影（粉调而非蓝调） */
  --shadow-sm: 0 2px 8px rgba(168, 159, 205, 0.12);
  --shadow-md: 0 4px 24px rgba(168, 159, 205, 0.18);
  --shadow-lg: 0 8px 40px rgba(168, 159, 205, 0.22);

  /* 圆角 */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;

  /* 动画 */
  --ease-out: cubic-bezier(0.25, 0.8, 0.25, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

/* ---------- 背景动画（梦幻粉紫蓝弥漫） ---------- */
.bg-animation {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--gradient-bg);
  animation: gradientFlow 22s ease-in-out infinite;
  background-size: 200% 200%;
}

.bg-animation::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: radial-gradient(
    ellipse at 25% 30%,
    rgba(240, 216, 235, 0.55) 0%,
    rgba(195, 198, 230, 0.2) 40%,
    transparent 70%
  );
  animation: floatGlow 14s ease-in-out infinite;
}

.bg-animation::after {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: radial-gradient(
    ellipse at 75% 70%,
    rgba(228, 239, 255, 0.55) 0%,
    rgba(255, 234, 243, 0.25) 50%,
    transparent 75%
  );
  animation: floatGlow 18s ease-in-out infinite reverse;
}

@keyframes gradientFlow {
  0%, 100% { background-position: 0% 0%; filter: hue-rotate(0deg) brightness(1); }
  50% { background-position: 100% 100%; filter: hue-rotate(3deg) brightness(1.02); }
}

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 30px) scale(0.98); }
}

/* ---------- 应用容器（左右布局） ---------- */
.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  max-width: 430px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* 左侧图标栏 */
.side-rail {
  width: 68px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(16px + env(safe-area-inset-top)) 6px calc(16px + env(safe-area-inset-bottom));
  gap: 6px;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(255, 255, 255, 0.55);
  overflow-y: auto;
  scrollbar-width: none;
}

.side-rail::-webkit-scrollbar { display: none; }

.rail-logo {
  font-size: 1.7rem;
  margin-bottom: 10px;
  animation: heartbeat 2s ease-in-out infinite;
}

.rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  padding: 10px 2px;
  border-radius: 14px;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
  color: var(--text-secondary);
  transition: all 0.25s var(--ease-spring);
}

.rail-item:active { transform: scale(0.92); }

.rail-item.active {
  background: linear-gradient(135deg, var(--accent-2), var(--primary-light));
  color: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(168, 159, 205, 0.35);
}

.rail-item.active .rail-icon { transform: scale(1.1); }

.rail-icon {
  font-size: 1.3rem;
  transition: transform 0.25s var(--ease-spring);
  line-height: 1;
}

.rail-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.rail-spacer { flex: 1; }

/* 右侧内容区 */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(16px + env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}

.main-content::-webkit-scrollbar { display: none; }

/* ---------- 页面过渡 ---------- */
.page {
  animation: pageEnter 0.4s var(--ease-out);
}

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

.page-exit {
  animation: pageExit 0.25s var(--ease-out) forwards;
}

@keyframes pageExit {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-12px); }
}

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--gradient-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-out);
  opacity: 0;
  transform: translateY(20px);
  animation: cardEnter 0.5s var(--ease-out) forwards;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.12s; }
.card:nth-child(3) { animation-delay: 0.19s; }
.card:nth-child(4) { animation-delay: 0.26s; }
.card:nth-child(5) { animation-delay: 0.33s; }
.card:nth-child(6) { animation-delay: 0.40s; }
.card:nth-child(7) { animation-delay: 0.47s; }
.card:nth-child(8) { animation-delay: 0.54s; }
.card:nth-child(9) { animation-delay: 0.61s; }
.card:nth-child(10) { animation-delay: 0.68s; }

@keyframes cardEnter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- 标题区 ---------- */
.page-header {
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeIn 0.4s var(--ease-out) 0.1s forwards;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(114, 116, 154, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 20px rgba(114, 116, 154, 0.4);
}

.btn-secondary {
  background: rgba(114, 116, 154, 0.1);
  color: var(--primary);
}

.btn-secondary:hover {
  background: rgba(114, 116, 154, 0.18);
}

.btn-full {
  width: 100%;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

/* ---------- 输入框 ---------- */
.input-group {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input, .textarea, .select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid rgba(114, 116, 154, 0.15);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-primary);
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
}

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(114, 116, 154, 0.1);
}

.textarea {
  min-height: 100px;
  resize: vertical;
}

/* ---------- 工作台头部 ---------- */
.workbench-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 14px;
  opacity: 0;
  animation: fadeIn 0.4s var(--ease-out) 0.05s forwards;
}

.wb-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.wb-title .deco {
  font-size: 0.85rem;
  padding: 2px 10px;
  background: var(--accent-2);
  color: var(--primary-dark);
  border-radius: 20px;
  font-weight: 700;
  transform: rotate(-3deg);
  box-shadow: 0 2px 10px rgba(240, 216, 235, 0.5);
}

.wb-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.wb-progress {
  text-align: right;
}

.wb-progress .pct {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}

.wb-progress .lbl {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

/* ---------- 月历组件 ---------- */
.cal-card { padding: 16px 14px; }

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

.cal-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cal-nav {
  display: flex;
  gap: 4px;
}

.cal-nav button {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 8px;
  background: rgba(114, 116, 154, 0.1);
  color: var(--primary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}

.cal-nav button:active { transform: scale(0.88); }

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

.cal-weekday {
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-light);
  padding: 4px 0;
  font-weight: 600;
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  color: var(--text-primary);
  transition: all 0.2s var(--ease-spring);
}

.cal-cell:active { transform: scale(0.85); }

.cal-cell.other-month { color: var(--text-light); opacity: 0.4; }

.cal-cell.today {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(114,116,154,0.35);
}

.cal-cell.selected:not(.today) {
  background: rgba(114, 116, 154, 0.15);
  color: var(--primary);
  font-weight: 700;
}

.cal-dots {
  display: flex;
  gap: 2px;
  height: 4px;
  margin-top: 1px;
}

.cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.cal-dot.checkup { background: var(--warning); }
.cal-dot.mood { background: #C97B8E; }
.cal-dot.todo { background: var(--success); }
.cal-cell.today .cal-dot { background: #fff; }

/* ---------- 待办内联添加 ---------- */
.todo-add-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(114, 116, 154, 0.15);
}

.todo-add-row .input {
  flex: 1;
  padding: 10px 14px;
  font-size: 0.88rem;
  border-radius: 20px;
}

.todo-add-row .btn {
  padding: 10px 18px;
  font-size: 0.85rem;
  border-radius: 20px;
  flex-shrink: 0;
}

/* ---------- 骨架屏 ---------- */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.3) 25%,
    rgba(255,255,255,0.6) 50%,
    rgba(255,255,255,0.3) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-card {
  height: 80px;
  margin-bottom: 16px;
}

/* ---------- Toast 提示 ---------- */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 12px 24px;
  background: rgba(61, 58, 80, 0.9);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  z-index: 1000;
  transition: transform 0.3s var(--ease-spring);
  backdrop-filter: blur(8px);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  opacity: 0;
  animation: fadeIn 0.5s var(--ease-out) 0.2s forwards;
}

.empty-state .emoji {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.empty-state .text {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ---------- 头像/角标 ---------- */
.avatar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.avatar-wife { background: #C97B8E; }
.avatar-husband { background: #7B8EC9; }

/* ---------- 日期标签 ---------- */
.date-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(114, 116, 154, 0.1);
  color: var(--primary);
}

/* ---------- 进度条 ---------- */
.progress-bar {
  height: 6px;
  background: rgba(114, 116, 154, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.8s var(--ease-out);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  animation: progressGlow 2s infinite;
}

@keyframes progressGlow {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* ---------- 心情选择器 ---------- */
.mood-selector {
  display: flex;
  justify-content: space-around;
  padding: 16px 0;
}

.mood-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  transition: all 0.3s var(--ease-spring);
  border: 2px solid transparent;
}

.mood-option:active {
  transform: scale(0.92);
}

.mood-option.selected {
  border-color: var(--primary);
  background: rgba(114, 116, 154, 0.08);
  animation: moodBounce 0.4s var(--ease-spring);
}

.mood-option .emoji {
  font-size: 2rem;
  transition: transform 0.3s var(--ease-spring);
}

.mood-option.selected .emoji {
  transform: scale(1.2);
}

.mood-option .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

@keyframes moodBounce {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ---------- 待办条目 ---------- */
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(114, 116, 154, 0.08);
  animation: slideInRight 0.3s var(--ease-out) forwards;
  opacity: 0;
}

.todo-item:last-child { border-bottom: none; }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.todo-checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(114, 116, 154, 0.3);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s var(--ease-spring);
  font-size: 0.8rem;
  color: transparent;
}

.todo-checkbox.checked {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  animation: checkPop 0.3s var(--ease-spring);
}

@keyframes checkPop {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.todo-text {
  flex: 1;
  font-size: 0.95rem;
  transition: all 0.3s;
}

.todo-text.completed {
  text-decoration: line-through;
  color: var(--text-light);
}

.todo-category {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(114, 116, 154, 0.08);
  color: var(--text-secondary);
}

/* ---------- 产检时间线 ---------- */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(114, 116, 154, 0.15);
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(114, 116, 154, 0.2);
  border: 2px solid var(--accent);
  transition: all 0.3s;
}

.timeline-item.completed::before {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(123, 175, 142, 0.15);
}

.timeline-item.upcoming::before {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(114, 116, 154, 0.15);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(114, 116, 154, 0.15); }
  50% { box-shadow: 0 0 0 8px rgba(114, 116, 154, 0.05); }
}

/* ---------- 数字滚动 ---------- */
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  animation: countUp 0.5s var(--ease-out);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ---------- 心跳动画（孕周） ---------- */
.heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.05); }
  30% { transform: scale(1); }
  45% { transform: scale(1.03); }
}

/* ---------- 涟漪效果 ---------- */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(114, 116, 154, 0.15);
  transform: scale(0);
  animation: rippleEffect 0.5s var(--ease-out);
  pointer-events: none;
}

@keyframes rippleEffect {
  to { transform: scale(4); opacity: 0; }
}

/* ---------- 浮动按钮 ---------- */
.fab {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom));
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(114, 116, 154, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
  transition: all 0.3s var(--ease-spring);
}

.fab:active {
  transform: scale(0.88);
}

/* ---------- 弹窗/抽屉 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61, 58, 80, 0.4);
  z-index: 200;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
  backdrop-filter: blur(4px);
}

.modal {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 430px;
  background: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px;
  z-index: 201;
  transition: transform 0.4s var(--ease-spring);
  max-height: 80vh;
  overflow-y: auto;
}

.modal.show {
  transform: translateX(-50%) translateY(0);
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: rgba(114, 116, 154, 0.2);
  border-radius: 2px;
  margin: 0 auto 16px;
}

/* ---------- 日历热力图 ---------- */
.mood-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 12px;
}

.mood-day {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  transition: transform 0.2s;
  cursor: default;
}

.mood-day:hover {
  transform: scale(1.1);
}

.mood-day.has-mood {
  cursor: pointer;
}

/* ---------- 图表容器 ---------- */
.chart-container {
  position: relative;
  height: 240px;
  margin-top: 12px;
}

/* ---------- 分隔线 ---------- */
.divider {
  height: 1px;
  background: rgba(114, 116, 154, 0.1);
  margin: 16px 0;
}

/* ---------- 响应式安全区 ---------- */
@supports (padding: max(0px)) {
  .main-content {
    padding-right: max(14px, env(safe-area-inset-right));
  }
}

/* ---------- 登录页特殊样式 ---------- */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 40px 32px;
  text-align: center;
}

.login-logo {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: heartbeat 2s ease-in-out infinite;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.login-form {
  width: 100%;
  max-width: 320px;
}

/* ---------- 双列统计 ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---------- 标签选择器 ---------- */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  background: rgba(114, 116, 154, 0.08);
  color: var(--text-secondary);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s;
}

.tag.selected {
  background: rgba(114, 116, 154, 0.15);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

/* ---------- 百科周详情 ---------- */
.wiki-week-row {
  padding: 14px 0;
  border-bottom: 1px solid rgba(114, 116, 154, 0.08);
  cursor: pointer;
  transition: background 0.2s;
}

.wiki-week-row:active { background: rgba(114, 116, 154, 0.04); }

.wiki-detail {
  display: none;
  margin-top: 10px;
  padding: 12px;
  background: rgba(114, 116, 154, 0.04);
  border-radius: 10px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.wiki-detail strong { color: var(--text-primary); }

/* ---------- 账本金额 ---------- */
.expense-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(114, 116, 154, 0.06);
}

.expense-amount {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

/* ---------- AI 问答 ---------- */
.ai-chat-placeholder {
  text-align: center;
  padding: 32px 20px;
}

.ai-chat-placeholder .icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.ai-sample-q {
  margin-top: 20px;
  padding: 16px;
  background: rgba(114, 116, 154, 0.06);
  border-radius: 12px;
  text-align: left;
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.8;
}

/* ---------- 统计卡片小字 ---------- */
.stats-grid .card {
  padding: 16px 12px;
}

/* ---------- 侧栏8项微调 ---------- */
.side-rail .rail-item {
  padding: 8px 2px;
  gap: 2px;
}

.side-rail .rail-icon { font-size: 1.2rem; }
.side-rail .rail-label { font-size: 0.58rem; }

/* ============================================
   反模板 UI 增强
   ============================================ */

/* ---------- 颗粒纹理覆盖 ---------- */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

/* ---------- Hero 孕周卡片（视觉焦点） ---------- */
.hero-week-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(255, 234, 243, 0.4));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.7);
  text-align: center;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: cardEnter 0.6s var(--ease-out) 0.1s forwards;
}

.hero-week-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(240,216,235,0.4), transparent 70%);
  border-radius: 50%;
}

.hero-week-card::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -15%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(228,239,255,0.35), transparent 70%);
  border-radius: 50%;
}

.hero-week-fruit {
  font-size: 3rem;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.hero-week-number {
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.1;
  position: relative;
  z-index: 1;
}

.hero-week-number small {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.hero-week-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 8px;
  position: relative;
  z-index: 1;
}

/* 进度环 */
.progress-ring-wrap {
  margin: 14px auto 4px;
  width: 72px;
  height: 72px;
  position: relative;
  z-index: 1;
}

.progress-ring-wrap svg {
  transform: rotate(-90deg);
}

.progress-ring-wrap .ring-bg {
  stroke: rgba(168, 159, 205, 0.15);
  fill: none;
}

.progress-ring-wrap .ring-fill {
  stroke: url(#ringGradient);
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s var(--ease-out);
}

.progress-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
}

/* ---------- 多样化卡片处理 ---------- */

/* 带色卡片 */
.card-accent {
  background: linear-gradient(145deg, rgba(240,216,235,0.5), rgba(228,239,255,0.35));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.5);
}

.card-accent-blue {
  background: linear-gradient(145deg, rgba(228,239,255,0.5), rgba(195,198,230,0.3));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.5);
}

/* 统计行（非网格） */
.stat-row {
  display: flex;
  gap: 12px;
}

.stat-row .card {
  flex: 1;
  margin-bottom: 0;
  padding: 14px 12px;
  text-align: center;
}

/* 重点卡（更大） */
.card-feature {
  padding: 22px 18px;
  text-align: left;
}

.card-feature .stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.card-feature .stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.card-feature .stat-sub {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* ---------- 待办条目优化 ---------- */
.todo-item {
  padding: 12px 0;
}

/* ---------- 侧栏指示器 ---------- */
.rail-item {
  position: relative;
}

.rail-item.active::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 2px;
  background: var(--primary-dark);
  animation: indicatorSlide 0.3s var(--ease-spring);
}

/* ---------- 减少动画偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .bg-animation,
  .bg-animation::before,
  .bg-animation::after,
  .heartbeat,
  .rail-logo,
  .progress-fill::after {
    animation: none !important;
  }
  .card, .page, .hero-week-card {
    animation-duration: 0.01s !important;
  }
}

/* ---------- Capsule 首页：仅作用于总览页 ---------- */
body:has(.capsule-overview) { background: #F5F5F0; }
body:has(.capsule-overview) .bg-animation { display: none; }
.capsule-overview {
  --cap-bg: #F5F5F0;
  --cap-ink: #1A1A1A;
  --cap-line: #1E1E1E;
  --cap-coral: #E85D4E;
  --cap-lime: #C4D94E;
  --cap-sky: #8BB4F7;
  --cap-lavender: #C5B5E0;
  --cap-violet: #A06CE8;
  --cap-yellow: #F2D160;
  --cap-shadow: rgba(26, 26, 26, .11);
  color: var(--cap-ink);
  font-family: 'Space Grotesk', 'PingFang SC', sans-serif;
  padding: 4px 0 18px;
  position: relative;
}
.capsule-overview * { box-sizing: border-box; }
.capsule-overview button, .capsule-overview input { font-family: inherit; }
.capsule-overview h1, .capsule-overview h2, .capsule-overview .hero-title { font-family: 'Bodoni Moda', 'ZCOOL XiaoWei', 'Songti SC', serif; }
.capsule-atmosphere { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.atmo-pill, .atmo-dot { position: absolute; display: grid; place-items: center; border: 2px solid var(--cap-line); box-shadow: 4px 4px 0 var(--cap-shadow); font-size: .61rem; font-weight: 700; letter-spacing: .08em; }
.atmo-pill { border-radius: 999px; height: 25px; padding: 0 10px; }
.atmo-coral { background: var(--cap-coral); right: 4px; top: 8px; transform: rotate(10deg); }
.atmo-sky { background: var(--cap-sky); left: -22px; top: 195px; transform: rotate(-13deg); }
.atmo-dot { width: 19px; height: 19px; border-radius: 50%; background: var(--cap-lime); right: 13px; top: 215px; }
.capsule-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 10px 8px 20px; position: relative; z-index: 1; animation: capsule-rise .45s ease-out both; }
.capsule-kicker, .section-pill, .stat-chip, .capsule-hero .hero-tag, .capsule-tip > div > span { display: inline-block; border: 2px solid var(--cap-line); border-radius: 999px; padding: 4px 9px; background: var(--cap-yellow); font-size: .58rem; font-weight: 700; letter-spacing: .1em; line-height: 1; }
.capsule-header h1 { margin: 9px 0 2px; font-size: clamp(2rem, 10vw, 2.8rem); line-height: .9; letter-spacing: -.05em; }
.capsule-header p { margin: 0; color: rgba(26,26,26,.62); font-size: .73rem; }
.capsule-done { width: 55px; height: 55px; padding: 4px; border: 2px solid var(--cap-line); border-radius: 50%; background: #fff; box-shadow: 5px 5px 0 var(--cap-shadow); color: var(--cap-ink); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.capsule-done:hover { transform: translate(-2px, -2px) rotate(-5deg); box-shadow: 7px 7px 0 var(--cap-shadow); }
.capsule-done:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--cap-shadow); }
.capsule-done span { display: block; font-size: 1.25rem; line-height: 1.1; }.capsule-done small { display: block; margin-top: 1px; font-size: .48rem; font-weight: 700; }
.capsule-hero { position: relative; overflow: hidden; padding: 23px 21px 18px; border: 2px solid var(--cap-line); border-radius: 30px; background: #fff; box-shadow: 8px 8px 0 var(--cap-shadow); animation: capsule-rise .5s .08s ease-out both; }
.capsule-hero::after { content: ''; position: absolute; width: 102px; height: 102px; border: 2px solid var(--cap-line); border-radius: 50%; background: var(--cap-lime); right: -37px; top: -30px; opacity: .9; }
.capsule-hero .hero-tag { background: var(--cap-coral); position: relative; z-index: 1; }
.hero-title { display: flex; align-items: flex-end; gap: 4px; position: relative; z-index: 1; margin: 14px 0 8px; line-height: .8; }
.hero-title span { font-size: 2.25rem; letter-spacing: -.11em; }.hero-title strong { font-family: 'DM Serif Display', 'ZCOOL XiaoWei', serif; font-size: clamp(2.5rem, 13vw, 3.5rem); letter-spacing: -.07em; }.hero-title em { margin: 0 0 13px 4px; font-family: 'DM Serif Display', 'ZCOOL XiaoWei', serif; font-size: .8rem; font-style: normal; font-weight: 400; }
.capsule-hero > p { max-width: 255px; margin: 0 0 18px; font-size: .78rem; line-height: 1.65; color: rgba(26,26,26,.72); }.capsule-hero > p b { color: var(--cap-coral); }
.pregnancy-progress { position: relative; z-index: 1; }.progress-top, .progress-foot { display: flex; justify-content: space-between; align-items: center; font-size: .62rem; font-weight: 600; }.progress-top b { color: var(--cap-coral); font-size: .76rem; }.progress-track { height: 17px; margin: 6px 0 5px; overflow: hidden; border: 2px solid var(--cap-line); border-radius: 999px; background: var(--cap-bg); }.progress-track i { display: block; width: var(--progress); height: 100%; border-right: 2px solid var(--cap-line); border-radius: 999px; background: var(--cap-coral); animation: fill-progress .9s .35s cubic-bezier(.2,.8,.2,1) both; transform-origin: left; }.progress-foot { color: rgba(26,26,26,.55); font-size: .55rem; }
.capsule-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin: 19px 0; }.capsule-stat { min-width: 0; padding: 15px 13px 13px; border: 2px solid var(--cap-line); border-radius: 24px; box-shadow: 6px 6px 0 var(--cap-shadow); color: var(--cap-ink); text-align: left; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; animation: capsule-rise .5s .16s ease-out both; }.capsule-stat:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--cap-shadow); }.capsule-stat:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--cap-shadow); }.checkup-stat { background: var(--cap-sky); }.weight-stat { background: var(--cap-lavender); }.capsule-stat .stat-chip { padding: 3px 6px; background: rgba(255,255,255,.58); font-size: .47rem; }.capsule-stat strong { display: block; margin: 14px 0 5px; overflow: hidden; font-family: 'DM Serif Display', 'ZCOOL XiaoWei', serif; font-size: 1.65rem; font-weight: 400; line-height: .9; letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }.capsule-stat strong small { margin-left: 2px; font-family: 'DM Serif Display', 'ZCOOL XiaoWei', serif; font-size: .66rem; letter-spacing: 0; }.capsule-stat p { min-height: 28px; margin: 0; font-size: .58rem; line-height: 1.45; }.capsule-stat p i { float: right; font-size: .9rem; font-style: normal; }
.capsule-todos { margin: 0 0 19px; padding: 19px 17px 16px; border: 2px solid var(--cap-line); border-radius: 30px; background: #fff; box-shadow: 8px 8px 0 var(--cap-shadow); animation: capsule-rise .5s .24s ease-out both; }.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 15px; }.section-pill { background: var(--cap-lime); }.section-heading h2 { margin: 8px 0 0; font-size: 1.7rem; line-height: .95; letter-spacing: -.05em; }.section-heading > b { font-family: 'DM Serif Display', serif; font-size: 2.2rem; font-weight: 400; line-height: .8; letter-spacing: -.04em; }.section-heading > b small { font-family: 'DM Serif Display', serif; font-size: .72rem; letter-spacing: 0; }
.capsule-todo { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1.5px solid rgba(26,26,26,.12); font-size: .79rem; animation: capsule-rise .4s calc(.32s + var(--todo-delay)) ease-out both; }.capsule-check { flex: 0 0 22px; width: 22px; height: 22px; border: 2px solid var(--cap-line); border-radius: 50%; background: var(--cap-bg); color: var(--cap-ink); font-size: .72rem; font-weight: 800; cursor: pointer; transition: transform .18s ease, background .18s ease; }.capsule-check:hover { transform: rotate(-10deg) scale(1.08); }.capsule-todo.is-done .capsule-check { background: var(--cap-lime); }.capsule-todo.is-done span { color: rgba(26,26,26,.42); text-decoration: line-through; text-decoration-thickness: 1.5px; }.capsule-empty { margin: 8px 0 12px; color: rgba(26,26,26,.55); font-size: .75rem; line-height: 1.6; }
.capsule-add { display: flex; gap: 7px; margin-top: 14px; }.capsule-add .input { min-width: 0; padding: 10px 12px; border: 2px solid var(--cap-line); border-radius: 999px; background: var(--cap-bg); box-shadow: none; font-size: .72rem; }.capsule-add .input:focus { border-color: var(--cap-line); box-shadow: 3px 3px 0 var(--cap-shadow); }.capsule-add button { flex: 0 0 auto; padding: 0 11px; border: 2px solid var(--cap-line); border-radius: 999px; background: var(--cap-yellow); color: var(--cap-ink); box-shadow: 3px 3px 0 var(--cap-shadow); font-size: .66rem; font-weight: 700; cursor: pointer; transition: transform .18s ease; }.capsule-add button:active { transform: translate(2px,2px); box-shadow: none; }.capsule-add button span { font-size: .95rem; }
.capsule-tip { display: grid; grid-template-columns: 55px 1fr; gap: 13px; padding: 16px; border: 2px solid var(--cap-line); border-radius: 28px; background: var(--cap-yellow); box-shadow: 7px 7px 0 var(--cap-shadow); animation: capsule-rise .5s .32s ease-out both; }.tip-sticker { display: grid; place-items: center; width: 54px; height: 54px; border: 2px solid var(--cap-line); border-radius: 50%; background: var(--cap-coral); font-size: .64rem; font-weight: 700; line-height: 1.15; text-align: center; transform: rotate(-10deg); }.capsule-tip > div > span { padding: 3px 6px; background: rgba(255,255,255,.58); font-size: .48rem; }.capsule-tip h2 { margin: 7px 0 5px; font-size: 1.35rem; line-height: .95; letter-spacing: -.05em; }.capsule-tip p { margin: 3px 0; font-size: .66rem; line-height: 1.5; }.capsule-tip p b { font-weight: 700; }
@keyframes capsule-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } } @keyframes fill-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .capsule-overview *, .capsule-overview { animation: none !important; transition: none !important; } }

/* ---------- Capsule 侧栏：统一线稿导航 ---------- */
.side-rail {
  background: rgba(255, 254, 250, .78);
  border-right-color: rgba(26, 26, 26, .08);
}
.rail-logo {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  margin: 0 0 12px;
  border: 2px solid #1E1E1E;
  border-radius: 50%;
  background: #E85D4E;
  color: #1A1A1A;
  font-size: 1.08rem;
  line-height: 1;
  animation: none;
}
.side-rail .rail-item {
  min-height: 55px;
  padding: 7px 2px;
  border-radius: 18px;
  color: #807b8d;
  transition: transform .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.side-rail .rail-icon {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  font-size: initial;
  line-height: 1;
  transition: transform .18s ease, color .18s ease;
}
.side-rail .rail-item.active {
  background: #DDD4EE;
  color: #1A1A1A;
  box-shadow: 5px 6px 0 rgba(92, 79, 120, .14);
}
.side-rail .rail-item.active::before { background: #A890D0; }
.side-rail .rail-item.active .rail-icon { transform: scale(1.06); }
.side-rail .rail-label { color: inherit; font-size: .58rem; font-weight: 700; letter-spacing: .02em; }
.side-rail .rail-item:hover { color: #1A1A1A; transform: translateY(-1px); }
.side-rail .rail-item:active { transform: translateY(1px) scale(.96); }

/* ---------- Capsule 其余页面：统一工作台视觉 ---------- */
body { background: #F5F5F0; }
.bg-animation { display: none; }
.main-content { background: #F5F5F0; }
.page:not(.capsule-overview) {
  --cap-bg: #F5F5F0;
  --cap-ink: #1A1A1A;
  --cap-line: #1E1E1E;
  --cap-shadow: rgba(26, 26, 26, .11);
  --cap-coral: #E85D4E;
  --cap-lime: #C4D94E;
  --cap-sky: #8BB4F7;
  --cap-lavender: #DDD4EE;
  --cap-yellow: #F2D160;
  color: var(--cap-ink);
  font-family: 'Space Grotesk', 'PingFang SC', sans-serif;
  padding-top: 5px;
  opacity: 1;
  transform: none;
  animation: none;
}
.page:not(.capsule-overview) .page-header { margin: 8px 2px 19px; opacity: 1; animation: none; }
.page:not(.capsule-overview) .page-title {
  margin: 0;
  color: var(--cap-ink);
  font-family: 'Bodoni Moda', 'ZCOOL XiaoWei', serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.06em;
  line-height: .95;
}
.page:not(.capsule-overview) .page-subtitle { margin: 7px 0 0; color: rgba(26,26,26,.58); font-size: .68rem; }
.page:not(.capsule-overview) .card {
  margin-bottom: 14px;
  padding: 17px;
  border: 2px solid var(--cap-line);
  border-radius: 27px;
  background: #fffefa;
  box-shadow: 7px 7px 0 var(--cap-shadow);
  color: var(--cap-ink);
  backdrop-filter: none;
  opacity: 1;
  transform: none;
  animation: none;
}
.page:not(.capsule-overview) .card:nth-child(3n+2) { background: #fffefa; }
.page:not(.capsule-overview) .card:hover { transform: translate(-2px,-2px); box-shadow: 9px 9px 0 var(--cap-shadow); }
.page:not(.capsule-overview) .card > strong:first-child,
.page:not(.capsule-overview) .timeline + strong {
  display: inline-block !important;
  padding: 4px 8px;
  border: 2px solid var(--cap-line);
  border-radius: 999px;
  background: var(--cap-lime);
  color: var(--cap-ink) !important;
  font-size: .62rem !important;
  font-weight: 700;
  letter-spacing: .035em;
}
.page:not(.capsule-overview) .btn {
  min-height: 39px;
  padding: 9px 14px;
  border: 2px solid var(--cap-line);
  border-radius: 999px;
  font-family: 'Space Grotesk', 'PingFang SC', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  box-shadow: 3px 3px 0 var(--cap-shadow);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.page:not(.capsule-overview) .btn-primary { background: var(--cap-yellow); color: var(--cap-ink); }
.page:not(.capsule-overview) .btn-primary:hover { background: #f7dd7b; box-shadow: 5px 5px 0 var(--cap-shadow); }
.page:not(.capsule-overview) .btn-secondary { background: var(--cap-lavender); color: var(--cap-ink); }
.page:not(.capsule-overview) .btn:active { transform: translate(2px,2px) scale(1); box-shadow: 1px 1px 0 var(--cap-shadow); }
.page:not(.capsule-overview) .input,
.page:not(.capsule-overview) .textarea,
.page:not(.capsule-overview) .select {
  border: 2px solid var(--cap-line);
  border-radius: 17px;
  background: var(--cap-bg);
  color: var(--cap-ink);
  font-size: .8rem;
  padding: 11px 12px;
}
.page:not(.capsule-overview) .input:focus,
.page:not(.capsule-overview) .textarea:focus,
.page:not(.capsule-overview) .select:focus { border-color: var(--cap-line); box-shadow: 3px 3px 0 var(--cap-shadow); }
.page:not(.capsule-overview) .input-label { color: var(--cap-ink); font-size: .72rem; }
.page:not(.capsule-overview) .stat-number,
.page:not(.capsule-overview) .date-badge,
.page:not(.capsule-overview) .expense-amount { font-family: 'DM Serif Display', 'ZCOOL XiaoWei', serif; }
.page:not(.capsule-overview) .stat-number { color: var(--cap-ink); font-size: 1.85rem; font-weight: 400; letter-spacing: -.04em; }
.page:not(.capsule-overview) .stat-label { color: rgba(26,26,26,.55); font-size: .64rem; }
.page:not(.capsule-overview) .stats-grid { gap: 11px; }
.page:not(.capsule-overview) .stats-grid .card { min-width: 0; padding: 16px 11px; text-align: left !important; }
.page:not(.capsule-overview) .stats-grid .card:first-child { background: var(--cap-sky); }
.page:not(.capsule-overview) .stats-grid .card:nth-child(2) { background: var(--cap-lavender); }
.page:not(.capsule-overview) .date-badge {
  padding: 4px 8px;
  border: 2px solid var(--cap-line);
  border-radius: 999px;
  background: var(--cap-yellow) !important;
  color: var(--cap-ink) !important;
  font-size: .68rem;
  font-weight: 400;
}
.page:not(.capsule-overview) .timeline { padding-left: 25px; }
.page:not(.capsule-overview) .timeline::before { left: 9px; width: 2px; border-radius: 0; background: rgba(26,26,26,.18); }
.page:not(.capsule-overview) .timeline-item { padding-bottom: 18px; }
.page:not(.capsule-overview) .timeline-item::before { left: -21px; width: 13px; height: 13px; border: 2px solid var(--cap-line); background: #fffefa; }
.page:not(.capsule-overview) .timeline-item.completed::before { background: var(--cap-lime); box-shadow: none; }
.page:not(.capsule-overview) .timeline-item.upcoming::before { background: var(--cap-coral); box-shadow: none; animation: none; }
.page:not(.capsule-overview) .todo-item { gap: 10px; padding: 10px 0; border-bottom-color: rgba(26,26,26,.13); opacity: 1; animation: none; }
.page:not(.capsule-overview) .todo-checkbox { border-color: var(--cap-line); border-radius: 50%; background: #fffefa; }
.page:not(.capsule-overview) .todo-checkbox.checked { border-color: var(--cap-line); background: var(--cap-lime); color: var(--cap-ink); animation: none; }
.page:not(.capsule-overview) .tag { padding: 6px 10px; border: 2px solid var(--cap-line); border-radius: 999px; background: #fffefa; color: var(--cap-ink); font-size: .68rem; }
.page:not(.capsule-overview) .tag.selected { border-color: var(--cap-line); background: var(--cap-lavender); color: var(--cap-ink); }
.page:not(.capsule-overview) .empty-state { border: 2px dashed rgba(26,26,26,.28); border-radius: 25px; background: rgba(255,254,250,.55); }
.modal { border: 2px solid #1E1E1E; border-bottom: 0; border-radius: 28px 28px 0 0; background: #fffefa; box-shadow: 0 -6px 0 rgba(26,26,26,.1); }
.modal-handle { background: #1E1E1E; }
@media (max-width: 360px) {
  .page:not(.capsule-overview) .page-title { font-size: 1.7rem; }
  .page:not(.capsule-overview) .card { padding: 14px; }
}

/* ---------- 待产包：名称 / 数量 / 备注清单 ---------- */
.bag-page { padding-bottom: 28px; }
.bag-list { margin: 0 0 26px; }
.bag-list-title { display: flex; align-items: center; justify-content: space-between; margin: 0 3px 10px; }
.bag-list-title span { font-family: 'Bodoni Moda', 'ZCOOL XiaoWei', serif; font-size: 1.32rem; font-weight: 700; letter-spacing: -.05em; }
.bag-list-title b { padding: 4px 8px; border: 2px solid #1E1E1E; border-radius: 999px; background: #E85D4E; color: #1A1A1A; font-family: 'DM Serif Display', serif; font-size: .68rem; font-weight: 400; }
.bag-category { padding: 14px 12px !important; overflow: hidden; }
.bag-category-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 10px; }
.bag-category-head span { padding: 4px 8px; border: 2px solid #1E1E1E; border-radius: 999px; background: #C4D94E; font-size: .65rem; font-weight: 700; letter-spacing: .04em; }
.bag-category-head small { color: rgba(26,26,26,.5); font-family: 'DM Serif Display', serif; font-size: .75rem; }
.bag-columns, .bag-row { display: grid; grid-template-columns: 26px minmax(58px, .95fr) 52px minmax(95px, 1.45fr); column-gap: 7px; }
.bag-columns { padding: 0 2px 6px; color: rgba(26,26,26,.47); font-size: .55rem; font-weight: 700; letter-spacing: .03em; }
.bag-row { align-items: start; padding: 10px 2px; border-top: 1.5px solid rgba(26,26,26,.11); color: #1A1A1A; transition: opacity .18s ease; }
.bag-check { display: grid; width: 21px; height: 21px; place-items: center; margin-top: 1px; padding: 0; border: 2px solid #1E1E1E; border-radius: 50%; background: #fffefa; color: #1A1A1A; cursor: pointer; font-size: .68rem; font-weight: 800; line-height: 1; }
.bag-check:hover { transform: rotate(-8deg) scale(1.07); }
.bag-row.is-checked { opacity: .47; }
.bag-row.is-checked .bag-check { background: #C4D94E; }
.bag-row.is-checked .bag-name { text-decoration: line-through; }
.bag-name { padding-top: 2px; font-size: .68rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.bag-quantity { padding-top: 2px; color: #E85D4E; font-family: 'DM Serif Display', 'ZCOOL XiaoWei', serif; font-size: .76rem; line-height: 1.2; text-align: center; }
.bag-note { color: rgba(26,26,26,.58); font-size: .56rem; line-height: 1.48; overflow-wrap: anywhere; }
.bag-footnote { color: rgba(26,26,26,.58); font-size: .63rem; line-height: 1.65; text-align: center; }
.content-icon, .inline-icon, .section-icon, .button-icon {
  width: 1em;
  height: 1em;
  vertical-align: -.16em;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}
.section-icon { margin-right: 3px; font-size: .95em; }
.button-icon { margin-right: 2px; }
.empty-icon { display: inline-grid; width: 2.4rem; height: 2.4rem; place-items: center; margin: 0 auto 7px; color: #1A1A1A; }
.empty-icon .content-icon, .ai-page-icon .content-icon { width: 100%; height: 100%; }
.ai-page-icon { width: 3rem; height: 3rem; margin: 0 auto 12px; color: #1A1A1A; }
@media (max-width: 360px) {
  .bag-category { padding: 13px 10px !important; }
  .bag-columns, .bag-row { grid-template-columns: 24px minmax(51px, .9fr) 45px minmax(84px, 1.35fr); column-gap: 5px; }
  .bag-name { font-size: .63rem; }
  .bag-quantity { font-size: .7rem; }
  .bag-note { font-size: .52rem; }
}
