/* ═══════════════════════════════════════════════
   抗炎饮食课程 Demo · 设计系统
   依据 design.md — 禁止偏离色板与组件规范
   ═══════════════════════════════════════════════ */

:root {
  /* 色板（design.md 第二节） */
  --bg: #FDFBF7;
  --surface: #FFFFFF;
  --ink: #3D2C29;
  --ink-soft: #8A7A72;
  --primary: #E86FA4;
  --primary-deep: #D9538E;
  --accent: #F08C5A;
  --violet: #8B5FBF;
  --violet-soft: #EDE4F7;
  --leaf: #8BA84E;
  --sky: #7EC8E3;
  --flame: #E05A4E;
  --line: #EFE9E2;

  --grad-main: linear-gradient(135deg, #F08C5A 0%, #E86FA4 100%);
  --grad-badge: linear-gradient(160deg, #A98BE0, #E86FA4);

  --r-card: 24px;
  --r-photo: 20px;
  --shadow: 0 2px 12px rgba(61, 44, 41, .06);
  --shadow-lift: 0 8px 28px rgba(61, 44, 41, .12);
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'PingFang SC', 'Noto Sans SC', -apple-system, sans-serif;
  background: #EFE9E2;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; border: none; cursor: pointer; background: none; color: inherit; }

/* ═══════════ iPhone Mockup ═══════════
   内屏锁定 390×844（design.md）。桌面按视口等比缩放，
   所有 UI（含 overlay / FAB / tabbar）必须待在 .phone-screen 里。
   ═══════════ */

.stage {
  --phone-w: 406px;   /* 390 内屏 + 8×2 边框 */
  --phone-h: 860px;   /* 844 内屏 + 8×2 边框 */
  --fit: min(1, (100vw - 32px) / 406px, (100dvh - 56px) / 860px);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  padding: 8px 16px;
}

.phone-fit {
  width: calc(var(--phone-w) * var(--fit));
  height: calc(var(--phone-h) * var(--fit));
  overflow: hidden;
}

.phone {
  width: var(--phone-w);
  height: var(--phone-h);
  background: var(--ink);
  border-radius: 55px;
  padding: 8px;
  box-shadow: 0 24px 64px rgba(61, 44, 41, .28), inset 0 0 0 2px #5a4642;
  position: relative;
  transform: scale(var(--fit));
  transform-origin: top left;
}

.phone-island {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 34px;
  background: #1a1210;
  border-radius: 20px;
  z-index: 100;
  pointer-events: none;
}

.phone-screen {
  width: 390px;
  height: 844px;
  background: var(--bg);
  border-radius: 47px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.stage-hint {
  flex-shrink: 0;
  font-size: 12px;
  color: #B8AC9F;
  letter-spacing: .1em;
}

/* 真机宽度：去壳全屏，不再缩放 */
@media (max-width: 500px) {
  html, body { overflow: hidden; }
  .stage {
    --fit: 1;
    padding: 0;
    gap: 0;
  }
  .phone-fit { width: 100vw; height: 100dvh; }
  .phone {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    transform: none;
  }
  .phone-island { display: none; }
  .phone-screen {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
  .stage-hint { display: none; }
}

/* ═══════════ 通用排版 ═══════════ */

.serif-title {
  font-family: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.3;
  color: var(--ink);
}

.day-serif {
  font-family: 'Noto Serif SC', 'Songti SC', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--violet);
  letter-spacing: .05em;
  margin-bottom: 6px;
}

.screen {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 56px 20px 16px;
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }

/* 盖过 .screen-welcome { display:flex }，避免 hidden 失效撑破布局 */
.screen[hidden] { display: none !important; }

/* 入场动效（design.md 第六节） */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen > * { animation: riseIn .4s ease-out both; }
.screen > *:nth-child(2) { animation-delay: .06s; }
.screen > *:nth-child(3) { animation-delay: .12s; }
.screen > *:nth-child(4) { animation-delay: .18s; }
.screen > *:nth-child(5) { animation-delay: .24s; }

/* ═══════════ 按钮 ═══════════ */

.btn-primary {
  width: 100%;
  padding: 15px 0;
  border-radius: 999px;
  background: var(--grad-main);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .05em;
  box-shadow: 0 6px 18px rgba(232, 111, 164, .35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled {
  background: var(--line);
  color: var(--ink-soft);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-ghost {
  width: 100%;
  padding: 13px 0;
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 14px;
  font-weight: 500;
}

/* ═══════════ 欢迎页 ═══════════ */

.screen-welcome {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.welcome-hero {
  height: 340px;
  flex-shrink: 0;
  overflow: hidden;
}
.welcome-hero img { width: 100%; height: 100%; object-fit: cover; }

.welcome-body {
  flex: 1;
  padding: 28px 24px 40px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  margin-top: -28px;
  position: relative;
}

.welcome-sub {
  font-family: 'Noto Serif SC', 'Songti SC', serif;
  font-size: 17px;
  color: var(--ink);
  margin: 14px 0 10px;
  line-height: 1.6;
}

.welcome-desc { font-size: 14px; color: var(--ink-soft); line-height: 1.7; margin-bottom: 28px; }

.welcome-note {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
}

/* ═══════════ Day 0 基线 ═══════════ */

.nav-back {
  position: absolute;
  top: 56px;
  left: 16px;
  z-index: 50;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.85);
  box-shadow: var(--shadow);
  font-size: 20px;
  line-height: 36px;
  text-align: center;
  color: var(--ink);
}

.baseline-hero { height: 200px; border-radius: var(--r-photo); overflow: hidden; margin-bottom: 20px; }
.baseline-hero img { width: 100%; height: 100%; object-fit: cover; }

.baseline-desc { font-size: 14px; color: var(--ink-soft); line-height: 1.7; margin: 10px 0 20px; }
.baseline-desc strong { color: var(--ink); }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }

.photo-slot {
  aspect-ratio: 1;
  border-radius: 16px;
  border: 1.5px dashed var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color .2s, background .2s;
}
.photo-slot span { font-size: 28px; }
.photo-slot em { font-style: normal; font-size: 12px; color: var(--ink-soft); }
.photo-slot.filled { border: none; background: var(--violet-soft); }
.photo-slot.filled em { color: var(--violet); }

.baseline-diagnosis {
  background: var(--surface);
  border-radius: 16px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.7;
  box-shadow: var(--shadow);
  margin: 14px 0;
}
.baseline-diagnosis strong { color: var(--flame); }

.baseline-note { font-size: 12px; color: var(--ink-soft); text-align: center; margin: 16px 0; }

/* ═══════════ 评分 ═══════════ */

.score-big { text-align: center; margin: 10px 0; }
.score-big span {
  font-family: 'Noto Serif SC', serif;
  font-size: 56px;
  font-weight: 700;
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.score-big small { font-size: 18px; color: var(--ink-soft); margin-left: 4px; }

.dim-list { margin: 16px 0; }

.dim-row { margin-bottom: 12px; }
.dim-row .dim-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.dim-row .dim-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--violet-soft);
  overflow: hidden;
}
.dim-row .dim-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--grad-main);
  width: 0;
  transition: width .3s ease-out;
}
.dim-row.dim-neg .dim-fill { background: var(--flame); }

/* ═══════════ 今日屏 ═══════════ */

.today-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }

.streak { font-size: 13px; color: var(--accent); padding-top: 8px; }

.progress-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.progress-ico { font-size: 16px; }
.progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--violet-soft);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--grad-main);
  width: 0;
  transition: width .6s cubic-bezier(.2, .7, .3, 1);
}

.progress-days {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 20px;
}
.pd {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}
.pd.done { background: var(--primary); }
.pd.backfill { background: transparent; border: 1.5px solid var(--primary); }
.pd.assess { border-radius: 3px; transform: rotate(45deg); }

/* 任务卡（design.md 组件 2） */
.today-card, .bonus-card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  margin-bottom: 16px;
}

.knowledge-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--violet);
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--violet-soft);
  margin-bottom: 16px;
}
.knowledge-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .2s ease-out;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.knowledge-body.open { max-height: 300px; }
.knowledge-body-inner { padding: 10px 12px 4px; }

.task-box {
  border-left: 3px solid var(--accent);
  background: rgba(240, 140, 90, .07);
  border-radius: 0 14px 14px 0;
  padding: 14px;
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.7;
}
.task-box .task-label { font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 4px; letter-spacing: .05em; }

.meal-list { margin-bottom: 18px; }
.meal-row { display: flex; gap: 10px; margin-bottom: 10px; font-size: 13px; line-height: 1.6; }
.meal-row .meal-tag {
  flex-shrink: 0;
  width: 40px;
  font-size: 12px;
  color: var(--leaf);
  font-weight: 600;
  padding-top: 1px;
}
.meal-row .meal-text { color: var(--ink); }

/* 餐谱折叠（默认一行摘要） */
.meal-summary {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--bg);
  font-size: 12px;
  text-align: left;
}
.meal-sum-text { color: var(--ink-soft); flex: 1; }
.meal-more { flex-shrink: 0; color: var(--violet); font-weight: 500; white-space: nowrap; }
.meal-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height .2s ease-out;
}
.meal-detail.open { max-height: 240px; }
.meal-detail .meal-row { padding-top: 10px; }
.meal-detail .meal-row:first-child { padding-top: 12px; }

.checkin-btn-wrap { position: relative; }
.checkin-done {
  text-align: center;
  padding: 13px 0;
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 15px;
  font-weight: 500;
}

/* 打卡成功扩散圈 */
@keyframes ripple {
  from { opacity: .8; transform: scale(.8); }
  to   { opacity: 0; transform: scale(1.5); }
}
.ripple-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--grad-main);
  animation: ripple .6s ease-out forwards;
  pointer-events: none;
}

/* Quiz */
.quiz-box {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-bottom: 18px;
}
.quiz-q { font-size: 14px; font-weight: 600; line-height: 1.6; margin-bottom: 12px; }
.quiz-opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 8px;
  transition: border-color .15s, background .15s;
}
.quiz-opt.selected { border-color: var(--violet); background: var(--violet-soft); }
.quiz-opt:disabled { cursor: default; }
.quiz-feedback {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  margin-top: 6px;
}
.quiz-feedback.ok { background: rgba(139, 168, 78, .1); color: #5f7a2e; }
.quiz-feedback.no { background: rgba(126, 200, 227, .12); color: #3a7d99; }

/* 加分锦囊 */
.bonus-card { padding: 16px 20px; display: flex; align-items: center; gap: 12px; }
.bonus-star { font-size: 22px; opacity: .35; transition: opacity .3s; }
.bonus-star.lit { opacity: 1; }
.bonus-text { flex: 1; font-size: 13px; line-height: 1.6; }
.bonus-text .bonus-label { font-size: 11px; color: var(--violet); font-weight: 600; letter-spacing: .05em; }
.bonus-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 12px;
  font-weight: 500;
}

/* ═══════════ 目录屏 ═══════════ */

.list-header { margin-bottom: 18px; }
.list-sub { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }

.week-block { margin-bottom: 24px; }

.week-card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}
.week-thumb { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; flex-shrink: 0; }
.week-info { flex: 1; }
.week-title { font-family: 'Noto Serif SC', serif; font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.week-prog { font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.week-bar { height: 5px; border-radius: 999px; background: var(--violet-soft); overflow: hidden; }
.week-bar-fill { height: 100%; background: var(--grad-main); border-radius: 999px; transition: width .4s ease-out; }

.day-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--surface);
  border-radius: 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  width: 100%;
  text-align: left;
  transition: transform .15s ease;
}
.day-row:active { transform: scale(.98); }
.day-row .dr-day {
  font-family: 'Noto Serif SC', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--violet);
  width: 46px;
  flex-shrink: 0;
}
.day-row .dr-title { flex: 1; font-size: 14px; font-weight: 500; }
.day-row .dr-ico { font-size: 15px; }

.day-row.locked { filter: grayscale(.6); opacity: .55; }
.day-row.done .dr-title { color: var(--ink-soft); }
.day-row.assess-day { border: 1.5px solid var(--violet-soft); }

/* ═══════════ 评估屏 ═══════════ */

.assess-card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  margin-bottom: 16px;
}
.assess-stat-row { display: flex; gap: 12px; margin: 16px 0; }
.assess-stat {
  flex: 1;
  background: var(--bg);
  border-radius: 16px;
  padding: 14px;
  text-align: center;
}
.assess-stat .as-num {
  font-family: 'Noto Serif SC', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--violet);
}
.assess-stat .as-label { font-size: 11px; color: var(--ink-soft); margin-top: 4px; }

.feeling-slider { margin-bottom: 18px; }
.feeling-slider .fs-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.feeling-slider .fs-label em { font-style: normal; color: var(--ink-soft); }
.feeling-slider input[type="range"] {
  width: 100%;
  accent-color: var(--violet);
}

/* 徽章 */
.badge-wrap { text-align: center; padding: 30px 0 10px; perspective: 600px; }
.badge {
  width: 110px;
  height: 110px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--grad-badge);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  box-shadow: 0 12px 32px rgba(169, 139, 224, .4), inset 0 -6px 14px rgba(0,0,0,.12), inset 0 6px 14px rgba(255,255,255,.35);
  animation: badgeSpin .8s cubic-bezier(.2, .7, .3, 1) both;
}
@keyframes badgeSpin {
  from { transform: rotateY(0deg) scale(.6); opacity: 0; }
  to   { transform: rotateY(360deg) scale(1); opacity: 1; }
}
.badge-title { font-family: 'Noto Serif SC', serif; font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.badge-sub { font-size: 13px; color: var(--ink-soft); line-height: 1.6; }

/* ═══════════ 我的 ═══════════ */

.me-stats { display: flex; gap: 12px; margin-bottom: 20px; }
.me-stat {
  flex: 1;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 18px 12px;
  text-align: center;
}
.me-stat .ms-num {
  font-family: 'Noto Serif SC', serif;
  font-size: 28px;
  font-weight: 700;
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.me-stat .ms-label { font-size: 11px; color: var(--ink-soft); margin-top: 4px; }

.food-list-card {
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.8;
}
.overlay[hidden] { display: none; }
.screen[hidden] { display: none; }
.food-list-card h3 { font-family: 'Noto Serif SC', serif; font-size: 15px; margin-bottom: 10px; }
.food-list-card .fl-green strong { color: var(--leaf); }
.food-list-card .fl-red strong { color: var(--flame); }

/* ═══════════ 底部 Tab ═══════════ */

.tabbar {
  flex-shrink: 0;
  width: 100%;
  margin: 0;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 40;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--ink-soft);
  padding: 6px 0;
}
.tab span { font-size: 20px; }
.tab.active { color: var(--violet); font-weight: 600; }

/* ═══════════ 遮罩 + 评分弹窗 ═══════════ */

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(61, 44, 41, .4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.score-modal {
  width: 100%;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  max-height: 88%;
  overflow-y: auto;
  animation: riseIn .3s ease-out both;
}
.score-modal-hero {
  height: 90px;
  background: url('../assets/asset_food.jpg') center 60%/cover;
  filter: saturate(1.1);
  border-radius: 28px 28px 0 0;
}
.score-modal-body { padding: 20px 24px 32px; }
.scoring-text { text-align: center; font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; }
.score-final { text-align: center; }
.score-feedback { font-size: 14px; line-height: 1.7; margin: 10px 0 20px; color: var(--ink); }

/* ═══════════ 灵知AI ═══════════ */

.ai-fab {
  position: absolute;
  right: 16px;
  bottom: 76px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--grad-main);
  font-size: 24px;
  box-shadow: 0 8px 24px rgba(232, 111, 164, .45);
  z-index: 150;
  transition: transform .15s ease;
}
.ai-fab:active { transform: scale(.92); }

.overlay-ai { align-items: flex-end; }

.ai-drawer {
  width: 100%;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
  max-height: 72%;
  display: flex;
  flex-direction: column;
  animation: riseIn .3s ease-out both;
}
.ai-drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.ai-drawer-title { font-family: 'Noto Serif SC', serif; font-size: 17px; font-weight: 700; }
.ai-close { width: 30px; height: 30px; border-radius: 50%; background: var(--line); font-size: 13px; }

.ai-msgs { flex: 1; overflow-y: auto; min-height: 120px; margin-bottom: 12px; }

.ai-msg { margin-bottom: 12px; max-width: 85%; }
.ai-msg.user {
  margin-left: auto;
  background: var(--violet-soft);
  color: var(--ink);
  border-radius: 18px 18px 4px 18px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.6;
}
.ai-msg.bot {
  background: var(--surface);
  border: 1.5px solid var(--violet-soft);
  border-radius: 18px 18px 18px 4px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.7;
  box-shadow: var(--shadow);
}
.ai-msg.bot .ai-who { font-size: 11px; color: var(--violet); font-weight: 600; margin-bottom: 4px; }

.ai-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-quick-btn {
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--violet-soft);
  background: var(--surface);
  font-size: 12px;
  color: var(--violet);
  transition: background .15s;
}
.ai-quick-btn:active { background: var(--violet-soft); }

/* ═══════════ 冰箱贴清单卡（Day 1 任务素材） ═══════════ */

.fridge-card {
  background: var(--surface);
  border: 1.5px dashed var(--leaf);
  border-radius: var(--r-card);
  padding: 20px;
  margin: 14px 0;
  font-size: 13px;
  line-height: 1.9;
}
.fridge-card .fridge-title { font-family: 'Noto Serif SC', serif; font-weight: 700; margin-bottom: 8px; }

/* 冰箱贴三档（低成本/中成本/高成本） */
.fridge-tier {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.fridge-tier.tier-leaf { background: rgba(139, 168, 78, .10); }
.fridge-tier.tier-accent { background: rgba(240, 140, 90, .10); }
.fridge-tier.tier-violet { background: var(--violet-soft); }
.tier-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.tier-head strong { font-size: 13px; }
.tier-head em { font-size: 11px; font-style: normal; color: var(--ink-soft); white-space: nowrap; }
.tier-items { font-size: 12.5px; line-height: 1.8; color: var(--ink); }
.tier-leaf .tier-head strong { color: var(--leaf); }
.tier-accent .tier-head strong { color: var(--accent); }
.tier-violet .tier-head strong { color: var(--violet); }
.fridge-card .fl-green { color: #5f7a2e; }
.fridge-card .fl-red { color: var(--flame); }

/* ═══════════ M6：Quiz 加分 / 体感 chips / toast / 兑换卡 ═══════════ */

.quiz-bonus-row {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(139, 168, 78, .12);
  color: var(--leaf);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}
.quiz-bonus-row strong { color: var(--leaf); }

.somatic-row { margin-bottom: 14px; }
.somatic-label { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; text-align: center; }
.somatic-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.som-chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  color: var(--ink-soft);
  transition: all .15s;
}
.som-chip.on {
  background: var(--violet-soft);
  border-color: var(--violet);
  color: var(--violet);
  font-weight: 500;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  padding: 9px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 300;
  white-space: nowrap;
}
.toast.show { opacity: .95; transform: translateX(-50%) translateY(0); }

.redeem-row { display: flex; gap: 8px; margin: 10px 0 12px; }
.redeem-card {
  flex: 1;
  background: var(--bg);
  border-radius: 14px;
  padding: 10px 6px;
  text-align: center;
  font-size: 11px;
}
.redeem-card span { font-size: 20px; display: block; margin-bottom: 4px; }
.redeem-card strong { display: block; font-weight: 500; margin-bottom: 2px; }
.redeem-card em { font-style: normal; color: var(--accent); font-weight: 600; }

/* ═══════════ M7：问卷 / 情绪解锁 / 呼吸 ═══════════ */

.prefs-block { margin-bottom: 18px; }
.prefs-q { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.prefs-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.pref-opt {
  padding: 9px 15px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-soft);
  transition: all .15s;
}
.pref-opt.on {
  background: var(--violet-soft);
  border-color: var(--violet);
  color: var(--violet);
  font-weight: 500;
}

.emotion-link {
  display: block;
  margin: 14px auto 0;
  font-size: 12px;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.emotion-modal {
  width: 100%;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  max-height: 88%;
  overflow-y: auto;
  animation: riseIn .3s ease-out both;
}
.emotion-hero { width: 100%; height: 130px; object-fit: cover; border-radius: 28px 28px 0 0; }
.emotion-body { padding: 18px 24px 32px; text-align: center; }
.encourage-text {
  font-family: 'Noto Serif SC', 'Songti SC', serif;
  font-size: 16px;
  line-height: 1.8;
  margin: 8px 0 18px;
  color: var(--ink);
}
.emotion-modal .btn-ghost { margin-bottom: 10px; }

.breath-wrap { margin: 6px 0 16px; }
.breath-ring {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid var(--sky);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--ink);
  transition: transform 4s ease-in-out;
  background: rgba(126, 200, 227, .08);
}
.breath-count { font-size: 11px; color: var(--ink-soft); margin-top: 8px; }

/* ═══════════ M8：对比图 / 健康榜 / 食材频率 / 分享 ═══════════ */

.compare-card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.compare-title { font-family: 'Noto Serif SC', serif; font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.cmp-dim { margin-bottom: 10px; }
.cmp-label { font-size: 12px; color: var(--ink-soft); margin-bottom: 4px; }
.cmp-bars { display: flex; flex-direction: column; gap: 3px; }
.cmp-bar { display: flex; align-items: center; gap: 8px; }
.cmp-bar > div { height: 6px; border-radius: 999px; transition: width .4s ease-out; }
.cmp-bar.base > div { background: var(--line); }
.cmp-bar.now > div { background: var(--grad-main); }
.cmp-bar span { font-size: 10px; color: var(--ink-soft); width: 20px; }
.cmp-legend { font-size: 11px; color: var(--ink-soft); margin-top: 8px; }
.cmp-legend i { display: inline-block; width: 10px; height: 6px; border-radius: 3px; margin: 0 4px 0 10px; }
.cmp-legend i.lg-base { background: var(--line); }
.cmp-legend i.lg-now { background: var(--grad-main); }

.lb-star {
  font-size: 12px;
  color: var(--ink);
  background: rgba(240, 140, 90, .10);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  line-height: 1.6;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
}
.lb-row.me { background: var(--violet-soft); font-weight: 600; }
.lb-rank { width: 22px; color: var(--ink-soft); font-size: 12px; }
.lb-name { flex: 1; }
.lb-days { font-size: 11px; color: var(--ink-soft); }
.lb-avg { font-weight: 600; color: var(--accent); width: 26px; text-align: right; }
.lb-note { font-size: 11px; color: var(--ink-soft); margin-top: 10px; line-height: 1.6; }

.freq-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.freq-name { width: 52px; color: var(--ink); }
.freq-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.freq-bar > div { height: 100%; background: var(--grad-main); border-radius: 999px; }
.freq-n { width: 18px; text-align: right; color: var(--ink-soft); }

.share-modal {
  width: 100%;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  padding: 18px 20px calc(28px + env(safe-area-inset-bottom));
  max-height: 92%;
  overflow-y: auto;
  animation: riseIn .3s ease-out both;
}
.share-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.share-title { font-family: 'Noto Serif SC', serif; font-weight: 700; font-size: 16px; }
#share-canvas {
  width: 100%;
  border-radius: 16px;
  box-shadow: var(--shadow-lift);
  margin-bottom: 14px;
}
.share-actions { display: flex; flex-direction: column; gap: 10px; }