/* ══════════════════════════════════════════════════════════════════════
   减脂记录 · 样式
   
   设计方向：克制的极简。参照 Orea 的视觉语言（见截图拆解文档附录）。
   字体刻意使用 iOS 系统栈 —— 这是一个装进 iPhone 主屏幕的 App，
   系统字体是原生语汇；换成装饰性字体会让它像网页而不像 App。
   "刻意"体现在数字排版（tabular-nums）、精确的投影与间距上。
   ══════════════════════════════════════════════════════════════════════ */

/* ── 设计令牌 ────────────────────────────────────────────────────────── */
:root {
  /* 表面 */
  --bg: #F7F7F8;
  --card: #FFFFFF;
  --card-press: #FAFAFB;

  /* 文字层级 */
  --text: #1C1C28;
  --text-2: #4A4A55;
  --muted: #8A8A93;
  --faint: #C7C7CC;

  /* 语义色 */
  --accent: #4D7CFF;
  --carbs: #34A853;      /* 碳水 绿 */
  --fat: #4285F4;        /* 脂肪 蓝 */
  --protein: #F2994A;    /* 蛋白质 橙 */
  --energy: #E8543F;     /* 热量 红橙 */
  --weight: #E8912A;     /* 体重 琥珀 */
  --water: #3B9BFF;      /* 饮水 蓝 */
  --danger: #D14343;

  /* 轨道与分隔 */
  --track: #EFEFF1;
  --divider: #F0F0F2;

  /* 形状 */
  --r-card: 20px;
  --r-inner: 14px;
  --r-pill: 999px;

  /* 投影：极淡，只形成一圈几乎看不见的晕 */
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 6px 24px rgba(0, 0, 0, 0.08);

  /* 间距 */
  --page-x: 20px;
  --card-pad: 17px;
  --gap: 14px;
  --gap-lg: 18px;

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
          "Microsoft YaHei", sans-serif;

  --tab-h: 62px;
}

/* ── 基础 ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
  margin: 0;
}

button { background: none; border: 0; cursor: pointer; }
button:active { opacity: 0.6; }

/* 数字统一用等宽数位：让大数字在变化时不跳动，也让它们显得被设计过 */
.num, .kcal-value, .stat-value, .big-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ── 页面骨架 ────────────────────────────────────────────────────────── */
#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 var(--page-x);
  /* 底部留出悬浮标签栏的高度 + 安全区 */
  padding-bottom: calc(var(--tab-h) + 34px + env(safe-area-inset-bottom));
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 14px;
  min-height: 44px;
}

.page-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.022em;
  margin: 0;
}

.head-actions { display: flex; align-items: center; gap: 10px; }

/* 圆形图标按钮 */
.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, background 0.15s ease;
}
.icon-btn:active { transform: scale(0.94); background: var(--card-press); }
.icon-btn svg { width: 19px; height: 19px; display: block; }

/* 胶囊容器：并排的图标按钮 */
.pill-btn {
  display: flex; align-items: center; gap: 2px;
  height: 38px; padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--card);
  box-shadow: var(--shadow);
}
.pill-btn .icon-btn {
  width: 32px; height: 32px;
  background: none; box-shadow: none;
}

/* ── 卡片 ────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--r-card);
  padding: var(--card-pad);
  box-shadow: var(--shadow);
  margin-bottom: var(--gap);
}

.card-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 10px;
}
.card-label .emoji { font-size: 15px; line-height: 1; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* 大号数值：数值大、单位小、紧跟其后 */
.big-value {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.big-value .unit {
  font-size: 17px;
  font-weight: 600;
  margin-left: 3px;
  letter-spacing: 0;
}

.stat-value {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.stat-value .unit { font-size: 14px; font-weight: 600; margin-left: 3px; }

.caption { font-size: 13px; color: var(--muted); margin-top: 3px; }
.caption-sm { font-size: 12px; color: var(--faint); }

/* ── 周日期条 ────────────────────────────────────────────────────────── */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: var(--gap-lg);
}

.week-day {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px;
  border-radius: var(--r-inner);
  transition: background 0.18s ease;
}
.week-day .d { font-size: 15px; font-weight: 600; }
.week-day .w { font-size: 10.5px; color: var(--muted); }
.week-day.is-on {
  background: var(--card);
  box-shadow: var(--shadow);
}
.week-day.is-on .d { font-weight: 700; }
.week-day.is-today .d { color: var(--accent); }

/* ── 进度条 ──────────────────────────────────────────────────────────── */
.bar {
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--track);
  overflow: hidden;
}
.bar > i {
  display: block; height: 100%;
  border-radius: var(--r-pill);
  transition: width 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* 带圆点标记的进度条（剩余热量用） */
.bar-dotted { position: relative; height: 7px; }
.bar-dotted .dot {
  position: absolute; top: 50%;
  width: 14px; height: 14px;
  border-radius: var(--r-pill);
  background: var(--accent);
  transform: translate(-50%, -50%);
  transition: left 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
  box-shadow: 0 0 0 3px rgba(77, 124, 255, 0.14);
}

/* ── 双列网格 ────────────────────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.grid-2 > .card { margin-bottom: 0; }

/* ── 环形图 ──────────────────────────────────────────────────────────── */
.ring { display: block; flex: 0 0 auto; }
.ring circle { transition: stroke-dasharray 0.5s cubic-bezier(0.22, 0.61, 0.36, 1); }

/* 空心圆环指示器（卡片右上角） */
.ring-hollow {
  width: 26px; height: 26px;
  border-radius: var(--r-pill);
  border: 3px solid var(--track);
  flex: 0 0 auto;
}

/* ── 营养素三栏 ──────────────────────────────────────────────────────── */
.macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.macro { display: flex; flex-direction: column; gap: 2px; }
.macro .k { font-size: 12px; color: var(--muted); }
.macro .v { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* 带分隔线的三栏（饮食页主卡用） */
.macros-divided {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--divider);
}
.macros-divided .macro {
  padding: 0 12px;
  position: relative;
}
.macros-divided .macro + .macro::before {
  content: '';
  position: absolute; left: 0; top: 2px; bottom: 2px;
  width: 1px; background: var(--divider);
}

/* ── 分隔线 ──────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--divider); margin: 14px 0; }

/* ── 餐次分组 ────────────────────────────────────────────────────────── */
.meal-group { margin-bottom: var(--gap); }

.meal-group-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 4px 8px;
}
.meal-group-head .name { font-size: 15px; font-weight: 600; }
.meal-group-head .kcal {
  font-size: 15px; font-weight: 600; color: var(--energy);
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 4px;
}

.meal-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px var(--card-pad);
  background: var(--card);
  border-bottom: 1px solid var(--divider);
}
.meal-row:first-of-type { border-radius: var(--r-card) var(--r-card) 0 0; }
.meal-row:last-of-type {
  border-bottom: 0;
  border-radius: 0 0 var(--r-card) var(--r-card);
}
.meal-row:only-of-type { border-radius: var(--r-card); }

.meal-thumb {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--track);
  display: grid; place-items: center;
  font-size: 22px;
  flex: 0 0 auto;
  overflow: hidden;
}
.meal-thumb img { width: 100%; height: 100%; object-fit: cover; }

.meal-main { flex: 1 1 auto; min-width: 0; }
.meal-name {
  font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.meal-time { font-size: 12px; color: var(--muted); margin-top: 1px; }
.meal-kcal {
  font-size: 15px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

/* ── AI 建议 ─────────────────────────────────────────────────────────── */
.advice {
  display: flex; gap: 8px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--divider);
}
.advice .spark { flex: 0 0 auto; margin-top: 2px; }
.advice p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-2); }

/* ── 空状态 ──────────────────────────────────────────────────────────── */
.empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 34px 20px 26px;
  text-align: center;
}
.empty h3 {
  font-size: 15px; font-weight: 600; margin: 18px 0 0;
  color: var(--text-2); line-height: 1.5;
}

/* ── 悬浮底部标签栏 ──────────────────────────────────────────────────── */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 50;
  max-width: calc(100vw - 24px);
}

.tabbar-inner {
  display: flex;
  align-items: center;
  height: var(--tab-h);
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-float);
}

.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  width: 62px; height: 46px;
  border-radius: var(--r-pill);
  transition: background 0.2s ease;
}
.tab svg { width: 21px; height: 21px; }
.tab span { font-size: 10.5px; font-weight: 500; }
.tab.is-on {
  background: #E7E8EC;
}
.tab.is-on svg { stroke-width: 2.2; }

.fab {
  width: var(--tab-h); height: var(--tab-h);
  border-radius: var(--r-pill);
  background: var(--card);
  box-shadow: var(--shadow-float);
  display: grid; place-items: center;
  flex: 0 0 auto;
  transition: transform 0.16s ease;
}
.fab:active { transform: scale(0.92); }
.fab svg { width: 24px; height: 24px; }

/* ── 按钮 ────────────────────────────────────────────────────────────── */
.btn {
  display: block; width: 100%;
  padding: 14px 18px;
  border-radius: var(--r-inner);
  background: var(--accent);
  color: #fff;
  font-size: 16px; font-weight: 600;
  text-align: center;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.985); }
.btn[disabled] { background: #E7E8EC; color: var(--muted); }
.btn.ghost { background: #EEEFF3; color: var(--text); }
.btn.danger { background: #FDECEC; color: var(--danger); }

/* ── 设置列表 ────────────────────────────────────────────────────────── */
.list { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.list + .list { margin-top: var(--gap); }

.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px var(--card-pad);
  border-bottom: 1px solid var(--divider);
  width: 100%;
  text-align: left;
}
.list-row:last-child { border-bottom: 0; }
.list-row .ico {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 15px;
  flex: 0 0 auto;
}
.list-row .label { flex: 1 1 auto; font-size: 15px; }
.list-row .value { font-size: 15px; color: var(--muted); }
.list-row .chev { color: var(--faint); flex: 0 0 auto; }

.section-title {
  font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 20px 4px 8px;
}

/* ── 开关 ────────────────────────────────────────────────────────────── */
.switch {
  position: relative;
  width: 50px; height: 30px;
  border-radius: var(--r-pill);
  background: var(--track);
  transition: background 0.22s ease;
  flex: 0 0 auto;
}
.switch::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 26px; height: 26px;
  border-radius: var(--r-pill);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.switch.is-on { background: #34C759; }
.switch.is-on::after { transform: translateX(20px); }

/* ── 输入 ────────────────────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--r-inner);
  background: var(--track);
  border: 1px solid transparent;
  font-size: 16px;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.input:focus { background: var(--card); border-color: var(--accent); }
.input::placeholder { color: var(--faint); }

/* ── 弹窗 ────────────────────────────────────────────────────────────── */
.sheet-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom));
  animation: fade 0.2s ease;
}
@keyframes fade { from { opacity: 0; } }

.sheet {
  width: 100%; max-width: 520px;
  background: var(--card);
  border-radius: 26px;
  padding: 8px;
  box-shadow: var(--shadow-float);
  animation: rise 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
  margin-bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom));
}
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }

.sheet-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-radius: 18px;
  font-size: 16px; font-weight: 500;
  width: 100%; text-align: left;
  transition: background 0.16s ease;
}
.sheet-item:active { background: var(--card-press); }
.sheet-item .ico {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; font-size: 17px;
}

/* ── Toast ───────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tab-h) + 30px + env(safe-area-inset-bottom));
  background: rgba(28, 28, 40, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-size: 14px;
  z-index: 200;
  animation: rise 0.24s ease;
  max-width: calc(100vw - 40px);
  text-align: center;
}

/* ── 进入动画：一次编排好的错峰出现 ─────────────────────────────────── */
.stagger > * {
  animation: enter 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
}
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
.stagger > *:nth-child(6) { animation-delay: 0.22s; }
.stagger > *:nth-child(7) { animation-delay: 0.26s; }

@keyframes enter {
  from { opacity: 0; transform: translateY(9px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── 工具类 ──────────────────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════════════════
   识别结果页
   ══════════════════════════════════════════════════════════════════════ */

/* 顶部：圆形照片 + 菜名 */
.result-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 4px 0 22px;
}
.result-photo {
  width: 148px; height: 148px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: linear-gradient(145deg, #FDF6F8, #F4F1FB);
  display: grid; place-items: center;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.06);
}
.result-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.result-dish {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  text-align: center;
}

/* 食材行 */
.ing-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px var(--card-pad);
  border-top: 1px solid var(--divider);
  text-align: left;
  transition: background 0.15s ease;
}
.ing-row:active { background: var(--card-press); }

.ing-emoji {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--track);
  display: grid; place-items: center;
  font-size: 19px;
  flex: 0 0 auto;
}
.ing-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ing-name {
  font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ing-sub {
  font-size: 12.5px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.ing-kcal {
  font-size: 14.5px; font-weight: 600;
  flex: 0 0 auto;
  color: var(--text-2);
}

.tag-est, .tag-low {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 600;
  line-height: 1.5;
}
.tag-est { background: #FFF3E2; color: #B4700F; }
.tag-low { background: #F2F2F5; color: var(--muted); }

/* 提示卡 */
.hint-card {
  background: var(--card);
  border-radius: var(--r-card);
  padding: 14px 16px;
  margin-bottom: var(--gap);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
  box-shadow: var(--shadow);
  border-left: 3px solid var(--faint);
}
.hint-card b { font-weight: 650; }
.hint-card.ok { border-left-color: var(--carbs); }
.hint-card.warn { border-left-color: #E8A33D; }

/* 份量按钮 */
.portion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}
.portion-btn {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 10px 6px;
  border-radius: var(--r-inner);
  background: var(--track);
  transition: background 0.16s ease, transform 0.16s ease;
}
.portion-btn:active { transform: scale(0.96); }
.portion-btn.is-on { background: var(--accent); color: #fff; }
.portion-btn .pl { font-size: 13px; font-weight: 600; }
.portion-btn .pg { font-size: 11px; opacity: 0.7; }

/* 加减按钮 */
.step-btn {
  flex: 0 0 auto;
  width: 46px;
  padding: 13px 0;
  border-radius: var(--r-inner);
  background: var(--track);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background 0.16s ease;
}
.step-btn:active { background: #E4E4E8; }

/* 输入框去掉数字微调箭头，避免与加减按钮重复 */
.input[type="number"]::-webkit-outer-spin-button,
.input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* ── 识别中的遮罩 ────────────────────────────────────────────────────── */
.busy-mask {
  position: fixed; inset: 0;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 300;
  display: grid; place-items: center;
  animation: fade 0.2s ease;
}
.busy-box {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  font-size: 15px; font-weight: 500; color: var(--text-2);
}
.spinner {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 3px solid var(--track);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 文字记录弹窗里的圆形图标按钮 ────────────────────────────────────── */
.circle-btn {
  width: 42px; height: 42px;
  border-radius: var(--r-pill);
  background: var(--track);
  display: grid; place-items: center;
  flex: 0 0 auto;
  transition: background 0.16s ease, transform 0.16s ease;
}
.circle-btn:active { background: #E4E4E8; transform: scale(0.94); }
.circle-btn svg { width: 20px; height: 20px; display: block; }

/* 文字输入框：多行 */
textarea.input {
  font-family: inherit;
  min-height: 92px;
}

/* ── 食物搜索（纠正识别结果） ────────────────────────────────────────── */
.food-results {
  margin-top: 12px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 120px;
  border-radius: var(--r-inner);
  background: var(--track);
}

.food-result {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 13px;
  border-bottom: 1px solid var(--divider);
  text-align: left;
  transition: background 0.15s ease;
}
.food-result:last-child { border-bottom: 0; }
.food-result:active { background: #E4E4E8; }

.fr-emoji {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--card);
  display: grid; place-items: center;
  font-size: 17px;
  flex: 0 0 auto;
}
.fr-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fr-name {
  font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fr-sub { font-size: 11.5px; color: var(--muted); }

/* 生熟标记：两者热量能差 2–3 倍，必须显眼 */
.fr-state {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 7px;
  background: var(--card);
  color: var(--text-2);
  flex: 0 0 auto;
}
.fr-state:empty { display: none; }

/* ══════════════════════════════════════════════════════════════════════
   应用内相机取景页
   界面上不出现任何文字（与原版一致）：只有关闭、取景框、三个控件。
   ══════════════════════════════════════════════════════════════════════ */

.cam-view {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 150;
  overflow: hidden;
}

.cam-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 四角取景框：L 形，臂长与线宽按截图实测取值 */
.cam-frame {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: min(81vw, 318px);
  aspect-ratio: 1;
  pointer-events: none;
}
.cam-frame .c {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 2.5px solid #fff;
  border-radius: 3px;
}
.cam-frame .tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.cam-frame .tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 10px; }
.cam-frame .bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 10px; }
.cam-frame .br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }

/* 左上关闭：半透明黑圆 + 白叉 */
.cam-close {
  position: absolute;
  left: 25px;
  top: calc(80px + env(safe-area-inset-top));
  width: 27px;
  height: 27px;
  padding: 0;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  display: grid;
  place-items: center;
}
.cam-close svg { width: 13px; height: 13px; }

/* 底部一行三控件，垂直中心线统一 */
.cam-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(42px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
}

.cam-thumb {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  display: grid;
  place-items: center;
}
.cam-thumb svg { width: 21px; height: 21px; }

/* 快门：白色细外环 + 琥珀实心内圆 */
.cam-shutter {
  position: relative;
  width: 68px;
  height: 68px;
  padding: 0;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  transition: transform 0.14s ease;
}
.cam-shutter:active { transform: scale(0.93); }
.cam-shutter .ring {
  position: absolute;
  inset: 0;
  border-radius: var(--r-pill);
  border: 2.5px solid rgba(255, 255, 255, 0.85);
}
.cam-shutter .inner {
  width: 63px;
  height: 63px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, #F5CB67 0%, #EFC063 55%, #E9B85F 100%);
  display: grid;
  place-items: center;
  color: #fff;
  position: relative;
}
.cam-shutter .inner > svg:first-child { width: 27px; height: 27px; }
/* 相机图标右上角的四角星芒：暗示"这不是普通相机，是 AI 识别" */
.cam-shutter .spark {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 12px;
  height: 12px;
  color: #fff;
}
.cam-shutter.is-busy { opacity: 0.55; pointer-events: none; }

.cam-flash {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  display: grid;
  place-items: center;
  transition: opacity 0.16s ease, background 0.16s ease;
}
.cam-flash svg { width: 16px; height: 16px; }
.cam-flash.is-on { background: #EFC063; color: #3a2c10; }
.cam-flash.is-off { opacity: 0.4; }

/* 分辨率角标：调试用，正常使用时不抢视线 */
.cam-res {
  position: absolute;
  right: 14px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}
