/* ============================================================
   馨雨的小饭桌 · 设计系统
   配色：奶霜粉 / 蜜桃 / 薄荷 / 淡紫，圆润、柔软、有呼吸感
   ============================================================ */

:root {
  /* 颜色 */
  --bg-1: #FFF6F8;
  --bg-2: #FFFBF3;
  --bg-3: #F0FBF8;

  --card: #FFFFFF;
  --card-soft: #FFF9FB;

  --ink: #4A3B42;
  --ink-2: #7C6A72;
  --ink-3: #AFA0A7;

  --pink: #FF9CB4;
  --pink-deep: #FF7A9C;
  --pink-wash: #FFE8EE;

  --peach: #FFB98A;
  --peach-wash: #FFEEE2;

  --yellow: #FFD97D;
  --yellow-wash: #FFF6DF;

  --mint: #8FD9C4;
  --mint-wash: #E3F7F1;

  --lilac: #C3B2F0;
  --lilac-wash: #F0EBFC;

  --line: #F3E7EC;
  --line-2: #EFE3E8;

  --shadow-s: 0 2px 8px rgba(214, 158, 178, .10);
  --shadow-m: 0 8px 24px rgba(214, 158, 178, .14);
  --shadow-l: 0 16px 40px rgba(214, 158, 178, .20);
  --shadow-glow: 0 0 0 6px rgba(255, 156, 180, .16);

  --r-s: 14px;
  --r-m: 20px;
  --r-l: 28px;
  --r-xl: 36px;

  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, .61, .36, 1);

  --tabbar-h: 74px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "HarmonyOS Sans", "Noto Sans SC",
          "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

/* ---------------------------- 基础 ---------------------------- */

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(168deg, var(--bg-1) 0%, var(--bg-2) 46%, var(--bg-3) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

/* 顶部一层柔光，让画面不死板 */
body::before {
  content: "";
  position: fixed;
  inset: -20% -20% auto -20%;
  height: 60vh;
  background:
    radial-gradient(40% 55% at 18% 30%, rgba(255, 156, 180, .22), transparent 70%),
    radial-gradient(38% 50% at 82% 20%, rgba(195, 178, 240, .20), transparent 70%),
    radial-gradient(36% 46% at 55% 8%,  rgba(255, 217, 125, .18), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
}

button, input, textarea, select { font-family: inherit; color: inherit; }
button { border: none; background: none; cursor: pointer; }
h1, h2, h3, p { margin: 0; }

/* ---------------------------- 布局 ---------------------------- */

.app {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 18px calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 26px);
}

.page { display: none; animation: pageIn .42s var(--ease-out) both; }
.page.is-active { display: block; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------- 顶栏 ---------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.hello__sub {
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: .08em;
  margin-bottom: 5px;
}

.hello__title {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.2;
}

.bow { font-size: 18px; display: inline-block; transform: translateY(1px); }

.avatar {
  position: relative;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(140deg, var(--pink-wash), var(--lilac-wash));
  border: 2.5px solid #fff;
  box-shadow: var(--shadow-m);
  display: grid;
  place-items: center;
  transition: transform .25s var(--ease-bounce);
}
.avatar:active { transform: scale(.92); }
.avatar img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .3s;
}
.avatar img.is-on { opacity: 1; }
.avatar__fallback { font-size: 25px; }

/* ---------------------------- 主状态卡 ---------------------------- */

.hero {
  position: relative;
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow-l);
  overflow: hidden;
  margin-bottom: 16px;
}

/* 卡片右上角的小装饰 */
.hero::after {
  content: "";
  position: absolute;
  top: -46px; right: -46px;
  width: 132px; height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--pink-wash), rgba(255, 232, 238, 0) 72%);
  pointer-events: none;
}

.hero.is-due  { box-shadow: var(--shadow-l), 0 0 0 3px var(--pink-wash) inset; }
.hero.is-due::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: var(--r-xl);
  border: 2.5px solid var(--pink);
  animation: pulseRing 1.9s var(--ease-out) infinite;
  pointer-events: none;
}

@keyframes pulseRing {
  0%   { opacity: .85; transform: scale(1); }
  70%  { opacity: 0;   transform: scale(1.035); }
  100% { opacity: 0;   transform: scale(1.035); }
}

.hero__bubble {
  display: inline-block;
  background: var(--pink-wash);
  color: var(--pink-deep);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
  max-width: 100%;
  line-height: 1.45;
  animation: popIn .45s var(--ease-bounce) both;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(.9) translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.hero__clock {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  background: linear-gradient(120deg, var(--pink-deep), var(--peach) 60%, var(--lilac));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__count {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-2);
  line-height: 1.5;
}
.hero__count b { color: var(--pink-deep); font-weight: 800; font-variant-numeric: tabular-nums; }

.hero__bar {
  margin-top: 16px;
  height: 10px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.hero__barFill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--peach) 55%, var(--yellow));
  transition: width .8s var(--ease-out);
}

.hero__foot {
  margin-top: 11px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
}
.dotSep { opacity: .6; }

/* 该吃饭时出现的一排快捷按钮 */
.hero__actions {
  display: flex;
  gap: 9px;
  margin-top: 15px;
  animation: popIn .4s var(--ease-bounce) both;
}
.hero__actions .btn { flex: 1; padding: 12px 10px; font-size: 13px; }

/* ---------------------------- 三餐卡片 ---------------------------- */

.meals { display: flex; flex-direction: column; gap: 12px; }

.meal {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-radius: var(--r-l);
  padding: 15px 16px;
  box-shadow: var(--shadow-s);
  transition: transform .22s var(--ease-bounce), box-shadow .25s, opacity .3s;
  overflow: hidden;
}
.meal:active { transform: scale(.985); }

/* 左侧状态色条 */
.meal::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--line-2);
  transition: background .3s;
}

.meal__icon {
  width: 50px; height: 50px;
  flex: 0 0 50px;
  border-radius: 18px;
  display: grid; place-items: center;
  font-size: 25px;
  background: var(--yellow-wash);
  transition: transform .35s var(--ease-bounce), background .3s;
}
.meal__icon.is-bounce { animation: iconBounce .6s var(--ease-bounce); }
@keyframes iconBounce {
  0% { transform: scale(1); }
  45% { transform: scale(1.22) rotate(-7deg); }
  100% { transform: scale(1); }
}

.meal__body { flex: 1; min-width: 0; }

.meal__name {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: .01em;
  display: flex; align-items: center; gap: 7px;
}

.meal__tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2.5px 8px;
  border-radius: 999px;
  letter-spacing: .03em;
  white-space: nowrap;
}
.tag--ok   { background: var(--mint-wash);   color: #3FA88C; }
.tag--late { background: var(--yellow-wash); color: #C8912A; }
.tag--due  { background: var(--pink-wash);   color: var(--pink-deep); }
.tag--miss { background: #F4EFF1;            color: var(--ink-3); }

.meal__meta {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.meal__meta b { color: var(--ink-2); font-weight: 700; }

/* 打卡按钮 */
.check {
  position: relative;
  width: 52px; height: 52px;
  flex: 0 0 52px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 22px;
  background: var(--pink-wash);
  border: 2.5px solid transparent;
  transition: transform .22s var(--ease-bounce), background .25s, border-color .25s;
}
.check:active { transform: scale(.86); }
.check.is-on {
  background: linear-gradient(140deg, var(--pink), var(--peach));
  box-shadow: 0 6px 16px rgba(255, 122, 156, .38);
  animation: checkPop .55s var(--ease-bounce);
}
@keyframes checkPop {
  0%   { transform: scale(.7) rotate(-14deg); }
  55%  { transform: scale(1.16) rotate(6deg); }
  100% { transform: scale(1); }
}
.check.is-on::after {
  content: "";
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2.5px solid var(--pink);
  animation: ripple .6s var(--ease-out) forwards;
}
@keyframes ripple {
  from { opacity: .9; transform: scale(.7); }
  to   { opacity: 0;  transform: scale(1.5); }
}

/* 各餐配色 */
.meal[data-id="breakfast"] .meal__icon { background: var(--yellow-wash); }
.meal[data-id="breakfast"] .meal::before { background: var(--yellow); }
.meal[data-id="lunch"]     .meal__icon { background: var(--mint-wash); }
.meal[data-id="lunch"]     .meal::before { background: var(--mint); }
.meal[data-id="dinner"]    .meal__icon { background: var(--lilac-wash); }
.meal[data-id="dinner"]    .meal::before { background: var(--lilac); }

.meal.is-done { opacity: .72; }
.meal.is-done .meal__name { text-decoration: line-through; text-decoration-color: var(--pink); text-decoration-thickness: 2px; }
.meal.is-due  { box-shadow: var(--shadow-m), 0 0 0 2px var(--pink) inset; }
.meal.is-miss::before { background: var(--line-2); }
.meal.is-off { opacity: .45; }
.meal.is-off::before { background: var(--line-2); }

/* ---------------------------- 提示条 ---------------------------- */

.notice {
  margin-top: 14px;
  background: var(--card-soft);
  border: 2px dashed var(--line-2);
  border-radius: var(--r-m);
  padding: 13px 16px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.65;
  font-weight: 600;
}
.notice b { color: var(--pink-deep); }

/* ---------------------------- 通用卡片 / 按钮 ---------------------------- */

.card {
  background: var(--card);
  border-radius: var(--r-l);
  padding: 20px;
  box-shadow: var(--shadow-s);
  margin-bottom: 14px;
}
.card--danger { background: #FFF8F9; }

.card__title {
  font-size: 15.5px;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: .01em;
}

.hint {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
  margin-top: 10px;
}

.row-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .01em;
  transition: transform .2s var(--ease-bounce), box-shadow .25s, background .25s;
  white-space: nowrap;
}
.btn:active { transform: scale(.94); }

.btn--primary {
  background: linear-gradient(135deg, var(--pink), var(--peach));
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 122, 156, .32);
}
.btn--soft {
  background: var(--line);
  color: var(--ink-2);
}
.btn--soft:active { background: var(--line-2); }
.btn--danger {
  background: #FFE4EA;
  color: #E0577B;
}
.btn--wide { width: 100%; padding: 15px; font-size: 15px; border-radius: var(--r-m); }

.footNote {
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 18px 0 4px;
  letter-spacing: .04em;
}
.heartInline { color: var(--pink); }

/* ---------------------------- 记录页 ---------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
  margin-bottom: 14px;
}

.stat {
  background: var(--card);
  border-radius: var(--r-m);
  padding: 16px;
  box-shadow: var(--shadow-s);
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute; right: -22px; bottom: -22px;
  width: 66px; height: 66px; border-radius: 50%;
  background: var(--tint, var(--pink-wash));
  opacity: .55;
}
.stat__num {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  position: relative; z-index: 1;
}
.stat__num small { font-size: 13px; font-weight: 700; color: var(--ink-3); margin-left: 2px; }
.stat__label {
  margin-top: 5px;
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 700;
  position: relative; z-index: 1;
}

/* 月历 */
.cal__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.cal__title { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cal__nav {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink-2);
  font-size: 19px;
  font-weight: 700;
  display: grid; place-items: center;
  line-height: 1;
  padding-bottom: 3px;
  transition: background .2s, transform .2s var(--ease-bounce);
}
.cal__nav:active { background: var(--line-2); transform: scale(.9); }

.cal__week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}
.cal__week span {
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 700;
}

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

.day {
  aspect-ratio: 1 / 1.24;
  border-radius: 13px;
  background: var(--card-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  transition: transform .2s var(--ease-bounce), background .25s;
}
.day:active { transform: scale(.9); }
.day.is-empty { background: transparent; }
.day.is-today {
  background: var(--pink-wash);
  color: var(--pink-deep);
  box-shadow: 0 0 0 2px var(--pink) inset;
}
.day.is-future { opacity: .38; }
.day.is-selected { box-shadow: var(--shadow-glow), 0 0 0 2px var(--pink) inset; }

.day__dots { display: flex; gap: 3px; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: var(--line-2); }
.dot--ok   { background: var(--mint); }
.dot--late { background: var(--yellow); }
.dot--miss { background: #E7D7DD; }
.dot--none { background: #F0E7EA; }

.cal__legend {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
}
.cal__legend span { display: inline-flex; align-items: center; gap: 6px; }

/* 某天详情 */
.detailRow {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1.5px dashed var(--line);
  font-size: 13.5px;
  font-weight: 600;
}
.detailRow:last-child { border-bottom: none; }
.detailRow__l { display: flex; align-items: center; gap: 9px; }
.detailRow__r { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12.5px; }

/* ---------------------------- 设置页 ---------------------------- */

.setRow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1.5px dashed var(--line);
}
.setRow:last-of-type { border-bottom: none; padding-bottom: 0; }

.setRow__icon {
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 19px;
  background: var(--yellow-wash);
}

.setRow__body { flex: 1; min-width: 0; }
.setRow__name { font-size: 14.5px; font-weight: 800; }
.setRow__sub { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; font-weight: 600; }

.timeInput {
  border: 2px solid var(--line);
  background: var(--card-soft);
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 14.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  width: 108px;
  text-align: center;
  transition: border-color .2s, background .2s;
}
.timeInput:focus { outline: none; border-color: var(--pink); background: #fff; }

.numInput {
  border: 2px solid var(--line);
  background: var(--card-soft);
  border-radius: 12px;
  padding: 9px 10px;
  font-size: 14px;
  font-weight: 800;
  width: 76px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.numInput:focus { outline: none; border-color: var(--pink); background: #fff; }

/* 开关 */
.switch {
  position: relative;
  width: 50px; height: 30px;
  flex: 0 0 50px;
  border-radius: 999px;
  background: var(--line-2);
  transition: background .28s var(--ease-out);
}
.switch.is-on { background: linear-gradient(135deg, var(--pink), var(--peach)); }
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .16);
  transition: transform .28s var(--ease-bounce);
}
.switch.is-on::after { transform: translateX(20px); }

.textarea {
  width: 100%;
  border: 2px solid var(--line);
  background: var(--card-soft);
  border-radius: var(--r-m);
  padding: 13px 15px;
  font-size: 13.5px;
  line-height: 1.8;
  resize: vertical;
  transition: border-color .2s, background .2s;
}
.textarea:focus { outline: none; border-color: var(--pink); background: #fff; }

/* 照片格子 */
.photoGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.photoCell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--line);
}
.photoCell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photoCell__del {
  position: absolute;
  top: 4px; right: 4px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: rgba(74, 59, 66, .62);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  display: grid; place-items: center;
  backdrop-filter: blur(3px);
}
.photoCell__del:active { background: var(--pink-deep); }
.photoCell--builtin::after {
  content: "内置";
  position: absolute;
  left: 4px; bottom: 4px;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  color: var(--ink-2);
}
.photoGrid:empty::before {
  content: "还没有照片，点下面的按钮加一张吧～";
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--ink-3);
  padding: 14px 0;
  text-align: center;
}

/* ---------------------------- 底部导航 ---------------------------- */

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  width: calc(100% - 36px);
  max-width: 484px;
  height: var(--tabbar-h);
  border-radius: 26px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 10px 34px rgba(214, 158, 178, .24), 0 0 0 1.5px rgba(255, 255, 255, .9) inset;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  z-index: 50;
  padding: 0 8px;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0;
  border-radius: 18px;
  transition: transform .25s var(--ease-bounce);
  position: relative;
}
.tab:active { transform: scale(.9); }
.tab__icon { font-size: 21px; transition: transform .3s var(--ease-bounce), filter .3s; filter: grayscale(.65) opacity(.55); }
.tab__label { font-size: 10.5px; font-weight: 800; color: var(--ink-3); transition: color .25s; }
.tab.is-active .tab__icon { filter: none; transform: translateY(-1px) scale(1.1); }
.tab.is-active .tab__label { color: var(--pink-deep); }
.tab.is-active::before {
  content: "";
  position: absolute;
  top: 2px;
  width: 30px; height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--peach));
  animation: popIn .3s var(--ease-bounce);
}

/* ---------------------------- 弹层 ---------------------------- */

.sheet { position: fixed; inset: 0; z-index: 100; }
.sheet__back {
  position: absolute; inset: 0;
  background: rgba(74, 59, 66, .34);
  backdrop-filter: blur(4px);
  animation: fadeIn .28s both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet__panel {
  position: absolute;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  background: var(--card);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 26px 22px calc(env(safe-area-inset-bottom, 0px) + 26px);
  text-align: center;
  box-shadow: 0 -12px 44px rgba(214, 158, 178, .3);
  animation: sheetUp .46s var(--ease-bounce) both;
}
@keyframes sheetUp {
  from { transform: translate(-50%, 100%); }
  to   { transform: translate(-50%, 0); }
}

.sheet__photo {
  width: 108px; height: 108px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(140deg, var(--pink-wash), var(--lilac-wash));
  display: grid; place-items: center;
  font-size: 46px;
  border: 4px solid #fff;
  box-shadow: var(--shadow-m), var(--shadow-glow);
  animation: popIn .5s var(--ease-bounce) .08s both;
}
.sheet__photo img { width: 100%; height: 100%; object-fit: cover; }

.sheet__title { font-size: 21px; font-weight: 800; margin-bottom: 9px; }
.sheet__text {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.75;
  margin-bottom: 20px;
  font-weight: 600;
}

/* ---------------------------- Toast ---------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 30px);
  transform: translateX(-50%);
  background: rgba(74, 59, 66, .93);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-m);
  z-index: 200;
  animation: toastIn .38s var(--ease-bounce) both;
  max-width: 82%;
  text-align: center;
  line-height: 1.5;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 14px) scale(.92); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ---------------------------- 背景飘落 ---------------------------- */

.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.petal {
  position: absolute;
  top: -6vh;
  font-size: 15px;
  opacity: .5;
  animation: fall linear forwards;
}
@keyframes fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  12%  { opacity: .55; }
  88%  { opacity: .45; }
  100% { transform: translateY(112vh) rotate(320deg); opacity: 0; }
}

/* 打卡成功撒花 */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 150;
  overflow: hidden;
}
.confetti span {
  position: absolute;
  top: -8vh;
  font-size: 22px;
  animation: fall linear forwards;
}

/* ---------------------------- 小屏适配 ---------------------------- */

@media (max-width: 360px) {
  .hero__clock { font-size: 40px; }
  .hello__title { font-size: 20px; }
  .meal__icon { width: 44px; height: 44px; flex-basis: 44px; font-size: 22px; }
  .check { width: 46px; height: 46px; flex-basis: 46px; }
  .photoGrid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
