/* 共用组件：区块标题、统计卡片、记录图标、时间线、头像、底部导航。
   样式按原 styles.css 的顺序拆成 base → home → components → forms → features，index.html 按这个顺序加载；后面的覆盖前面的，调整时不要打乱顺序。 */

.section-block,
.page-heading {
  margin-top: 18px;
}

.section-heading {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.section-heading span {
  color: var(--muted);
  font-size: calc(13px * var(--fs, 1));
}

.compact-heading {
  margin-top: 18px;
  margin-bottom: 8px;
}

.feeding-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

/* 记录类型选择：底部中间“＋”弹出的菜单里，“日常”一组 3 列网格 */
.feed-type-grid {
  position: relative; /* reorder.js 用 offsetLeft/offsetTop 计算位置 */
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.feed-type-grid button {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-height: 92px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font-weight: 500;
  box-shadow: 0 10px 22px rgba(86, 151, 187, 0.12);
}

.feed-type-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-top: 8px;
  border-radius: 50%;
  font-size: calc(24px * var(--fs, 1));
}

.breast-icon {
  background: #ffe1ed;
}

.formula-icon {
  background: #e3efff;
}

.food-icon {
  background: #fff0cc;
}

.diaper-icon {
  background: #d7f6f4;
}

.supplement-icon {
  background: #e4f7ef;
}

.feeding-overview article {
  min-height: 76px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(86, 151, 187, 0.1);
}

.feeding-overview span {
  display: block;
  color: var(--muted);
  font-size: calc(12px * var(--fs, 1));
  font-weight: 500;
}

.feeding-overview strong {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  font-size: calc(18px * var(--fs, 1));
  line-height: 1.1;
}

.module-list,
.timeline,
.health-grid {
  display: grid;
  gap: 10px;
}

.home-timeline {
  position: relative;
  gap: 8px;
}

.module-row {
  width: 100%;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
}

.module-row strong {
  display: block;
  margin-bottom: 4px;
}

.module-mark {
  display: inline-block;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.feeding-mark {
  background: var(--green);
}

.vaccine-mark {
  background: var(--rose);
}

.checkup-mark {
  background: var(--blue);
}

.diary-mark {
  background: var(--gold);
}

.placeholder-panel,
.feature-panel,
.profile-card {
  padding: 18px;
}

.placeholder-panel p,
.feature-panel p,
.profile-card p {
  margin-top: 8px;
  line-height: 1.6;
}

.timeline {
  margin-top: 12px;
}

.timeline article {
  display: grid;
  grid-template-columns: 55px minmax(0, 1fr);
  gap: 24px;
  padding: 0;
  border: 0;
  background: transparent;
}

.timeline span {
  color: var(--text);
  font-size: calc(18px * var(--fs, 1));
  font-weight: 500;
}

.timeline strong {
  display: block;
  margin: 0;
}

.timeline-time {
  position: relative;
  padding-top: 10px;
  text-align: left;
}

.timeline-time small {
  margin-top: 1px;
  font-size: calc(11px * var(--fs, 1));
}

.timeline-card {
  min-height: 70px;
  padding: 14px 14px 14px 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(85, 148, 182, 0.12);
  position: relative;
}

.timeline-card::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 22px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(88, 169, 212, 0.14);
}

.timeline-card::after {
  content: "";
  position: absolute;
  left: -12px;
  top: 34px;
  bottom: -18px;
  width: 1px;
  background: rgba(88, 169, 212, 0.25);
}

.timeline article:last-child .timeline-card::after {
  display: none;
}

.record-icon {
  position: absolute;
  left: 12px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--text);
  font-size: calc(16px * var(--fs, 1));
  font-weight: 500;
}

.record-meta {
  margin-top: 6px;
}


.compact-modules .module-list {
  grid-template-columns: 1fr;
}

.timeline:empty {
  display: none;
}

.split-list {
  margin-top: 12px;
}

.health-grid {
  grid-template-columns: 1fr 1fr;
}

.feature-panel .module-mark {
  margin-bottom: 14px;
}

.feature-panel button {
  width: 100%;
  margin-top: 16px;
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--line);
}

.profile-card {
  gap: 14px;
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 480px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 64px 1fr 1fr; /* 首页、记录、中间「＋」、成长、健康 */
  gap: 4px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 -10px 30px rgba(88, 147, 178, 0.14);
}

.bottom-nav button {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: calc(12px * var(--fs, 1));
  font-weight: 500;
}

.bottom-nav button.active {
  background: #eaf7ff;
  color: var(--blue);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: calc(24px * var(--fs, 1));
  line-height: 1;
}
