:root {
  color-scheme: light;
  --bg: #7a8c64;
  --mint: #899772;
  --mint-strong: #708354;
  --surface: #f5f5ec;
  --cream: #e8eadf;
  --ink: #313329;
  --muted: #8f9387;
  --line: #dce0d3;
  --primary: #708354;
  --primary-deep: #53643f;
  --capsule: #dd6b45;
  --capsule-deep: #b85a25;
  --brown: #3d3b27;
  --gold: #d9a845;
  --aqua: #2f9ab0;
  --soft-shadow: 0 18px 46px rgba(61, 59, 39, 0.14);
  --card-radius: 28px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #7a8c64;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body.camera-flow-locked {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 20px 108px;
  position: relative;
}

.app-page {
  display: none;
  animation: pageIn 220ms ease;
}

.app-page.active {
  display: block;
}

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

.clock {
  margin-bottom: 30px;
  font-size: 1.1rem;
  font-weight: 900;
}

.page-hero,
.simple-top,
.profile-hero,
.camera-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.page-hero {
  min-height: 196px;
  align-items: flex-start;
  padding-top: 4px;
  background:
    radial-gradient(circle at 88% 36%, rgba(240, 242, 217, 0.22), transparent 28%),
    radial-gradient(circle at 70% 52%, rgba(231, 127, 63, 0.11), transparent 18%),
    linear-gradient(135deg, rgba(143, 154, 100, 0), rgba(78, 90, 49, 0.18));
}

.page-hero h1,
.profile-hero h1,
.camera-top h1,
.simple-top h1 {
  margin-bottom: 8px;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.page-hero p:not(.clock),
.profile-hero p:not(.clock),
.camera-top p {
  margin: 0;
  color: #4e5437;
  font-weight: 650;
}

.round-button,
.glass-button,
.text-back {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: rgba(229, 233, 201, 0.5);
  box-shadow: 0 10px 28px rgba(61, 59, 39, 0.12);
}

.daily-card,
.photo-entry-card,
.quick-actions,
.tip-card,
.banner-card,
.record-summary,
.food-list,
.profile-stats,
.member-card,
.settings-list,
.achievement-card,
.result-card,
.credibility-panel,
.question-panel,
.explosion-module,
.log-panel {
  border-radius: var(--card-radius);
  background: rgba(240, 242, 217, 0.95);
  border: 1px solid rgba(229, 233, 201, 0.82);
  box-shadow: var(--soft-shadow);
}

.daily-card {
  margin-top: -34px;
  padding: 24px 22px;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  align-items: center;
}

.calorie-orbit {
  width: 138px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle, var(--surface) 57%, transparent 59%),
    conic-gradient(var(--capsule) 0 72%, #c5cc9f 72% 100%);
}

.calorie-orbit span {
  display: block;
  margin-bottom: -18px;
  font-size: 2.45rem;
  font-weight: 900;
}

.calorie-orbit small {
  color: #232623;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.35;
}

.calorie-orbit.small {
  width: 126px;
}

.daily-copy p,
.record-summary p {
  margin-bottom: 4px;
  color: var(--muted);
  font-weight: 750;
}

.daily-copy strong,
.record-summary strong {
  display: block;
  margin-bottom: 18px;
  font-size: 1.45rem;
}

.macro-lines,
.mini-macros {
  display: grid;
  gap: 12px;
}

.macro-lines div {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.86rem;
}

.macro-lines i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--capsule);
}

.macro-lines div:nth-child(2) i {
  background: var(--gold);
}

.macro-lines div:nth-child(3) i {
  background: var(--aqua);
}

.macro-lines span {
  color: #3a403a;
  font-weight: 750;
}

.macro-lines b {
  font-weight: 900;
}

.photo-entry-card {
  margin-top: 18px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 14px;
  align-items: center;
  background:
    radial-gradient(circle at 82% 22%, rgba(231, 127, 63, 0.12), transparent 28%),
    linear-gradient(135deg, #d7ddbd 0%, var(--surface) 100%);
}

.photo-entry-card h2,
.section-head h2,
.tip-card h3,
.banner-card h3,
.result-card h2 {
  margin-bottom: 8px;
  font-size: 1.36rem;
}

.photo-entry-card p,
.tip-card p,
.banner-card p,
.range-copy,
.muted,
.layer-note {
  color: var(--muted);
  line-height: 1.55;
}

.primary-pill,
.primary-action,
.save-button {
  min-height: 44px;
  border-radius: 999px;
  padding: 0 20px;
  color: white;
  background: linear-gradient(135deg, var(--capsule), var(--capsule-deep));
  font-weight: 850;
  box-shadow: 0 12px 26px rgba(184, 90, 37, 0.22);
}

.entry-photo {
  height: 128px;
  overflow: hidden;
  border-radius: 22px;
}

.entry-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quick-actions {
  margin-top: 18px;
  padding: 16px 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.quick-actions button {
  min-height: 78px;
  display: grid;
  place-items: center;
  gap: 8px;
  color: #60665e;
  background: transparent;
}

.quick-actions span {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--capsule);
  background: rgba(229, 233, 201, 0.88);
  font-weight: 900;
}

.quick-actions small {
  font-weight: 750;
}

.section-head {
  margin: 24px 4px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-head button {
  color: var(--muted);
  background: transparent;
  font-weight: 750;
}

.tip-card {
  padding: 18px;
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 14px;
  align-items: center;
}

.tip-card button {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 18px;
  color: white;
  background: var(--capsule);
  font-weight: 800;
}

.tip-card.compact {
  display: block;
  margin-top: 18px;
  background: linear-gradient(135deg, #dfe4c3, var(--surface));
}

.water-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--capsule);
  background: rgba(229, 233, 201, 0.9);
}

.banner-card {
  min-height: 128px;
  margin-top: 18px;
  padding: 22px;
  background:
    radial-gradient(circle at 88% 48%, rgba(231, 127, 63, 0.16), transparent 24%),
    linear-gradient(135deg, #8f9a64, #dfe4c3 64%, var(--surface));
}

.camera-page {
  height: 100dvh;
  margin: -28px -20px 0;
  padding: 0 14px;
  color: white;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 16%, rgba(143, 154, 100, 0.34), transparent 28%),
    linear-gradient(180deg, #242916 0%, #15170d 100%);
}

.camera-page.camera-result {
  overflow-y: auto;
  padding-bottom: 28px;
  overscroll-behavior: contain;
}

.camera-top {
  display: none;
}

.camera-top h1 {
  color: white;
  font-size: 1.78rem;
}

.camera-top p {
  color: rgba(255, 255, 255, 0.74);
}

.glass-button,
.flash-button {
  color: white;
  background: rgba(246, 243, 220, 0.14);
  box-shadow: none;
}

.flash-button {
  min-height: 40px;
  border-radius: 999px;
  padding: 0 14px;
  font-weight: 750;
}

.camera-frame {
  position: relative;
  height: calc(100dvh - 150px);
  min-height: 520px;
  margin: 0;
  overflow: hidden;
  border-radius: 0 0 28px 28px;
  background: #242916;
  transition:
    height 720ms cubic-bezier(0.2, 0.7, 0.2, 1),
    min-height 720ms cubic-bezier(0.2, 0.7, 0.2, 1),
    margin 720ms cubic-bezier(0.2, 0.7, 0.2, 1),
    border-radius 720ms cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 720ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.camera-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.94);
  transition: transform 720ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 300ms ease;
}

.camera-frame p {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  color: white;
  background: rgba(0, 0, 0, 0.34);
  font-size: 0.86rem;
}

.camera-analyzing .camera-frame p,
.camera-revealing .camera-frame p,
.camera-review .camera-frame p,
.camera-result .camera-frame p {
  display: none;
}

.camera-float {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  z-index: 4;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(229, 233, 201, 0.16);
  backdrop-filter: blur(14px);
  font-weight: 900;
}

.camera-back {
  left: 18px;
  font-size: 2rem;
  line-height: 1;
}

.camera-flash {
  right: 18px;
}

.scan-layer,
.scan-beam-live,
.scan-grid-live {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scan-layer {
  z-index: 2;
  opacity: 0;
  transition: opacity 260ms ease;
}

.camera-analyzing .scan-layer,
.camera-revealing .scan-layer {
  opacity: 1;
}

.scan-beam-live {
  height: 34%;
  top: -34%;
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.12) 35%, rgba(231, 127, 63, 0.64) 50%, rgba(229, 233, 201, 0.2) 66%, transparent 100%);
  filter: blur(0.2px);
  animation: liveScan 1.65s linear infinite;
}

.scan-grid-live {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
}

.scan-dot-live {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f09b58;
  box-shadow: 0 0 12px rgba(231, 127, 63, 0.95), 0 0 28px rgba(229, 233, 201, 0.32);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.62);
  transition:
    left 420ms ease,
    top 420ms ease,
    opacity 260ms ease,
    transform 260ms ease;
}

.scan-dot-live.is-live {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@keyframes liveScan {
  from { transform: translateY(0); }
  to { transform: translateY(390%); }
}

.corner {
  position: absolute;
  width: 44px;
  height: 44px;
  border-color: var(--capsule);
}

.corner.tl {
  left: 10px;
  top: 10px;
  border-top: 6px solid;
  border-left: 6px solid;
  border-radius: 14px 0 0;
}

.corner.tr {
  right: 10px;
  top: 10px;
  border-top: 6px solid;
  border-right: 6px solid;
  border-radius: 0 14px 0 0;
}

.corner.bl {
  left: 10px;
  bottom: 10px;
  border-bottom: 6px solid;
  border-left: 6px solid;
  border-radius: 0 0 0 14px;
}

.corner.br {
  right: 10px;
  bottom: 10px;
  border-bottom: 6px solid;
  border-right: 6px solid;
  border-radius: 0 0 14px;
}

.result-screen {
  display: grid;
  gap: 14px;
  margin: -14px 0 0;
  color: var(--ink);
}

.camera-idle .camera-results,
.camera-analyzing .camera-results,
.camera-revealing .camera-results,
.camera-review .camera-results {
  display: none;
}

.camera-analyzing .camera-frame,
.camera-revealing .camera-frame,
.camera-review .camera-frame,
.camera-result .camera-frame {
  height: 48dvh;
  min-height: 360px;
  margin: 0 auto;
  border-radius: 0 0 30px 30px;
}

.camera-analyzing .camera-frame img,
.camera-revealing .camera-frame img,
.camera-review .camera-frame img,
.camera-result .camera-frame img {
  transform: scale(0.96);
}

.camera-analyzing .camera-frame::after,
.camera-revealing .camera-frame::after {
  content: "正在识别食材与热量...";
  position: absolute;
  left: 50%;
  bottom: 54px;
  transform: translateX(-50%);
  min-width: 172px;
  min-height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: white;
  background: rgba(231, 127, 63, 0.9);
  font-size: 0.86rem;
  font-weight: 850;
  box-shadow: 0 10px 28px rgba(184, 90, 37, 0.28);
}

.camera-analyzing .camera-frame::after,
.camera-revealing .camera-frame::after {
  display: none;
}

.scan-progress {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 12px;
  min-height: 148px;
  margin: 18px 10px 0;
  padding: 16px;
  border-radius: 22px;
  background: rgba(229, 233, 201, 0.08);
  border: 1px solid rgba(229, 233, 201, 0.12);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 420ms ease, transform 520ms ease;
}

.camera-analyzing .scan-progress,
.camera-revealing .scan-progress,
.camera-review .scan-progress {
  opacity: 1;
  transform: translateY(0);
}

.camera-result .scan-progress {
  display: none;
}

.scan-progress-line {
  min-height: 34px;
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.98rem;
  font-weight: 850;
}

.scan-progress-line::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--capsule);
  box-shadow: 0 0 14px rgba(231, 127, 63, 0.8);
}

.scan-progress-line span::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.16em;
  background: rgba(255, 255, 255, 0.72);
  animation: caretBlink 780ms steps(1) infinite;
}

@keyframes caretBlink {
  50% { opacity: 0; }
}

.result-card {
  padding: 18px;
}

.result-title-row {
  display: grid;
  grid-template-columns: 68px 1fr 72px;
  gap: 14px;
  align-items: center;
}

.result-title-row img {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  object-fit: cover;
}

.confidence {
  min-height: 58px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--capsule-deep);
  background: #f8ead3;
  font-weight: 900;
}

.nutrition-strip {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.nutrition-strip div {
  min-height: 72px;
  display: grid;
  place-items: center;
  gap: 3px;
  border-right: 1px solid var(--line);
}

.nutrition-strip div:last-child {
  border-right: 0;
}

.nutrition-strip span {
  color: var(--capsule);
  font-size: 1.25rem;
  font-weight: 900;
}

.nutrition-strip small,
.ingredient-detail p {
  color: var(--muted);
}

.ingredient-detail {
  margin-top: 20px;
}

.component-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.component-row span::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--capsule);
}

.component-row small {
  color: var(--muted);
}

.soft-button,
.secondary-action {
  min-height: 40px;
  border-radius: 999px;
  padding: 0 18px;
  color: var(--brown);
  background: var(--cream);
  font-weight: 800;
}

.camera-controls {
  position: sticky;
  bottom: 18px;
  z-index: 9;
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 94px 1fr;
  align-items: center;
  gap: 20px;
  padding: 0 28px;
}

.camera-idle .camera-controls {
  position: fixed;
  left: 50%;
  bottom: 26px;
  width: min(390px, 100%);
  transform: translateX(-50%);
}

.camera-analyzing .camera-controls,
.camera-revealing .camera-controls,
.camera-review .camera-controls,
.camera-result .camera-controls {
  display: none;
}

#meal-photo {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.camera-tool {
  min-height: 54px;
  display: grid;
  place-items: center;
  color: white;
  background: transparent;
  font-weight: 800;
}

.camera-tool.green {
  color: var(--capsule);
}

.shutter {
  width: 84px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: block;
  background: #fff;
  border: 7px solid var(--primary-deep);
  box-shadow: 0 0 0 8px #fff;
}

.credibility-panel,
.question-panel,
.explosion-module,
.log-panel {
  padding: 18px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--capsule-deep);
  font-size: 0.74rem;
  font-weight: 900;
}

.confidence-meter {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  align-items: center;
}

.confidence-meter span {
  font-weight: 900;
}

.meter-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #c5cc9f;
}

.meter-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--capsule);
}

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

.reason-card {
  min-height: 92px;
  padding: 10px;
  border-radius: 16px;
  background: #f8faf5;
}

.reason-card span,
.reason-card small {
  color: var(--muted);
  font-size: 0.72rem;
}

.reason-card strong {
  display: block;
  margin: 5px 0;
  font-size: 0.88rem;
}

.uncertainty-strip {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: #fff7e8;
}

.uncertainty-strip span {
  color: #a56c00;
  font-weight: 900;
}

.uncertainty-strip p {
  margin: 6px 0 0;
  color: #5d5140;
}

.slider {
  width: 100%;
  accent-color: var(--capsule);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.86rem;
}

.segmented {
  margin-top: 14px;
  padding: 5px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  border-radius: 999px;
  background: #d7ddbd;
}

.segment {
  min-height: 38px;
  border-radius: 999px;
  color: #667063;
  background: transparent;
  font-weight: 800;
  font-size: 0.82rem;
}

.segment.active {
  color: white;
  background: var(--capsule);
}

.dish-explosion-stage {
  position: relative;
  min-height: 240px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(135deg, #d7ddbd, var(--surface));
}

.dish-explosion-stage img {
  width: 210px;
  height: 210px;
  object-fit: contain;
  filter: drop-shadow(0 20px 36px rgba(61, 59, 39, 0.14));
}

.ingredient-chip {
  position: absolute;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--brown);
  background: var(--cream);
  font-weight: 850;
}

.chip-protein { left: 18px; top: 32px; }
.chip-sauce { right: 18px; top: 58px; }
.chip-veg { left: 28px; bottom: 48px; }
.chip-spice { right: 24px; bottom: 30px; }

.log-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.simple-top {
  min-height: 88px;
}

.text-back {
  font-size: 2rem;
  background: transparent;
  box-shadow: none;
}

.date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0 18px;
}

.date-row button {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--ink);
  background: transparent;
  font-weight: 800;
}

.date-row button:last-child {
  color: var(--brown);
  background: var(--cream);
}

.record-summary {
  padding: 20px;
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 18px;
  align-items: center;
  background: linear-gradient(135deg, #d7ddbd, var(--surface));
}

.mini-macros {
  color: #50584f;
  font-size: 0.78rem;
}

.meal-tabs {
  margin: 18px 0;
  padding: 5px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  border-radius: 999px;
  background: rgba(240, 242, 217, 0.92);
  box-shadow: var(--soft-shadow);
}

.meal-tabs button {
  min-height: 62px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.meal-tabs button.active {
  color: white;
  background: var(--capsule);
}

.food-list {
  padding: 14px;
}

.food-list article {
  min-height: 84px;
  display: grid;
  grid-template-columns: 66px 1fr auto;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.food-list article:last-of-type {
  border-bottom: 0;
}

.food-list img {
  width: 62px;
  height: 62px;
  border-radius: 12px;
  object-fit: cover;
}

.food-list h3 {
  margin: 0 0 4px;
}

.food-list p {
  margin: 0;
  color: var(--muted);
}

.food-list strong {
  font-size: 1.08rem;
}

.add-food {
  width: 100%;
  min-height: 54px;
  margin-top: 16px;
  border-radius: 999px;
  color: var(--brown);
  background: var(--cream);
  border: 1px solid var(--line);
  font-weight: 900;
}

.profile-hero {
  min-height: 234px;
  align-items: center;
}

.avatar {
  width: 74px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255, 253, 240, 0.25), rgba(231, 127, 63, 0.14)),
    url("./assets/dish-explosion-hero.png") center/cover;
  border: 4px solid white;
  box-shadow: var(--soft-shadow);
}

.scale-card {
  width: 112px;
  min-height: 104px;
  border-radius: 24px;
  padding: 16px;
  display: grid;
  align-content: center;
  background: linear-gradient(135deg, #a0aa71, var(--surface));
}

.scale-card small,
.profile-stats small {
  color: var(--muted);
  font-weight: 750;
}

.scale-card strong {
  margin-top: 6px;
  color: var(--brown);
  font-size: 1.42rem;
}

.profile-stats {
  margin-top: -18px;
  padding: 20px 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
}

.profile-stats div {
  display: grid;
  gap: 7px;
}

.profile-stats span {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--capsule);
  background: var(--cream);
}

.profile-stats strong {
  font-size: 1.1rem;
}

.member-card {
  margin-top: 18px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #ead8ae, var(--surface));
}

.member-card button {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 16px;
  color: white;
  background: var(--capsule);
  font-weight: 850;
}

.settings-list {
  margin-top: 18px;
  padding: 12px 18px;
}

.settings-list button {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  background: transparent;
  border-bottom: 1px solid var(--line);
  font-weight: 820;
}

.settings-list button:last-child {
  border-bottom: 0;
}

.settings-list small {
  color: var(--muted);
}

.trends-page {
  padding-top: 4px;
}

.trends-top {
  min-height: 88px;
}

.share-button {
  min-height: 38px;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(240, 242, 217, 0.86);
  box-shadow: 0 10px 26px rgba(61, 59, 39, 0.1);
  font-weight: 800;
}

.period-tabs {
  margin: 10px 0 18px;
  padding: 5px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-radius: 999px;
  background: rgba(240, 242, 217, 0.72);
}

.period-tabs button {
  min-height: 38px;
  border-radius: 999px;
  color: #60665e;
  background: transparent;
  font-weight: 800;
}

.period-tabs button.active {
  color: white;
  background: var(--capsule);
  box-shadow: 0 10px 24px rgba(184, 90, 37, 0.22);
}

.weight-hero-card,
.chart-card,
.trend-metrics,
.trend-analysis,
.goal-progress-card,
.trend-actions {
  border-radius: var(--card-radius);
  background: rgba(240, 242, 217, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--soft-shadow);
}

.weight-hero-card {
  padding: 22px 28px;
  display: grid;
  grid-template-columns: 1fr 128px;
  align-items: center;
  gap: 16px;
}

.weight-hero-card p {
  margin-bottom: 8px;
  color: #3d443c;
  font-weight: 800;
}

.weight-hero-card strong {
  display: block;
  font-size: 3.2rem;
  line-height: 1;
}

.weight-hero-card strong small,
.goal-delta strong small {
  font-size: 1rem;
  font-weight: 750;
}

.weight-hero-card span {
  display: inline-flex;
  margin-top: 14px;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--brown);
  background: var(--cream);
  font-weight: 850;
}

.goal-delta {
  text-align: center;
}

.goal-delta i {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--capsule);
  background: var(--cream);
  font-style: normal;
  font-weight: 900;
}

.goal-delta strong {
  color: var(--capsule);
  font-size: 1.7rem;
}

.chart-card {
  margin-top: 16px;
  padding: 18px;
}

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

.chart-head h2,
.trend-analysis h2,
.goal-progress-card h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
}

.chart-head button {
  color: var(--muted);
  background: transparent;
  font-weight: 750;
}

.weight-chart {
  position: relative;
  height: 274px;
  margin-top: 18px;
  padding-left: 30px;
}

.weight-chart::before {
  content: "";
  position: absolute;
  left: 52px;
  right: 8px;
  top: 22px;
  bottom: 50px;
  background:
    linear-gradient(#e3e6cf 1px, transparent 1px) 0 0 / 100% 48px;
}

.weight-chart .axis {
  position: absolute;
  left: 0;
  color: #8e948c;
  font-weight: 750;
}

.a56 { top: 14px; }
.a54 { top: 62px; }
.a52 { top: 110px; }
.a50 { top: 158px; }

.weight-chart svg {
  position: absolute;
  left: 38px;
  right: 0;
  top: 12px;
  width: calc(100% - 38px);
  height: 210px;
  overflow: visible;
}

.trend-fill {
  fill: url(#trendFill);
}

.trend-line {
  fill: none;
  stroke: var(--capsule);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-dots circle {
  fill: #fff;
  stroke: var(--capsule);
  stroke-width: 4;
}

.weight-chart text {
  fill: white;
  font-size: 15px;
  font-weight: 800;
  paint-order: stroke;
  stroke: var(--capsule);
  stroke-width: 12px;
  stroke-linejoin: round;
}

.chart-dates {
  position: absolute;
  left: 58px;
  right: 8px;
  bottom: 20px;
  display: flex;
  justify-content: space-between;
  color: #8e948c;
  font-weight: 750;
}

.chart-dates strong {
  color: var(--capsule-deep);
}

.chart-note {
  min-height: 44px;
  border-radius: 14px;
  display: grid;
  align-items: center;
  padding: 0 14px;
  color: var(--brown);
  background: var(--cream);
  font-weight: 760;
}

.trend-metrics {
  margin-top: 16px;
  padding: 18px 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  text-align: center;
}

.trend-metrics div {
  display: grid;
  gap: 7px;
}

.trend-metrics span {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--capsule);
  background: var(--cream);
}

.trend-metrics small,
.trend-metrics em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.trend-metrics strong {
  font-size: 1.15rem;
}

.trend-analysis {
  min-height: 114px;
  margin-top: 16px;
  padding: 18px;
  background:
    radial-gradient(circle at 86% 44%, rgba(231, 127, 63, 0.12), transparent 26%),
    linear-gradient(135deg, #d7ddbd, var(--surface));
}

.trend-analysis p {
  margin: 10px 0 0;
  color: #5b635a;
  line-height: 1.65;
}

.goal-progress-card {
  margin-top: 16px;
  padding: 18px;
}

.goal-line {
  height: 12px;
  margin: 22px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #c5cc9f;
}

.goal-line span {
  display: block;
  width: 75%;
  height: 100%;
  border-radius: inherit;
  background: var(--capsule);
}

.goal-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.goal-labels strong {
  color: var(--capsule-deep);
}

.trend-actions {
  margin-top: 16px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 12px;
  background: #d7ddbd;
}

.trend-actions button {
  min-height: 50px;
  border-radius: 999px;
  color: var(--brown);
  background: rgba(240, 242, 217, 0.86);
  font-weight: 900;
}

.trend-actions button:last-child {
  color: white;
  background: var(--capsule);
}

.achievement-card {
  margin-top: 18px;
  padding: 18px;
}

.badges {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  text-align: center;
}

.badges div {
  min-height: 78px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--cream);
}

.badges strong {
  color: var(--capsule);
  font-size: 1.45rem;
}

.badges small {
  color: var(--muted);
  font-size: 0.78rem;
}

.analysis-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  padding: 18px;
  background: rgba(10, 13, 7, 0.66);
  backdrop-filter: blur(10px);
}

.analysis-sheet.is-open {
  display: flex;
}

.analysis-card {
  width: min(100%, 430px);
  max-height: calc(100dvh - 44px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 30px;
  background: var(--surface);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.26);
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform 260ms ease, opacity 260ms ease;
}

.analysis-sheet.is-open .analysis-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.analysis-sheet.is-ready .analysis-photo,
.analysis-sheet.is-ready .analysis-steps {
  display: none;
}

.sheet-recognition .calibration-block,
.sheet-calibration .candidate-panel,
.sheet-calibration .recognition-block {
  display: none;
}

.sheet-recognition .analysis-card {
  cursor: pointer;
}

.sheet-recognition .analysis-content::after {
  content: "核对候选后点击底部按钮继续";
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.sheet-calibration .analysis-content::after {
  content: none;
}

.analysis-photo {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.analysis-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-beam {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(231, 127, 63, 0.34), transparent);
  animation: scan 1.5s linear infinite;
}

@keyframes scan {
  from { transform: translateY(-100%); }
  to { transform: translateY(100%); }
}

.vision-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.18) 1px, transparent 1px);
  background-size: 58px 58px;
}

.vision-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--capsule);
  box-shadow: 0 0 18px rgba(231, 127, 63, 0.88);
}

.dot-a { left: 24%; top: 34%; }
.dot-b { left: 62%; top: 42%; }
.dot-c { left: 48%; top: 66%; }

.analysis-content {
  padding: 20px;
}

.analysis-content h2 {
  margin-bottom: 12px;
  font-size: 1.36rem;
}

.analysis-steps {
  display: grid;
  gap: 10px;
}

.analysis-step {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  color: var(--muted);
}

.analysis-step > span {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 50%;
  background: #c5cc9f;
}

.analysis-step.active > span,
.analysis-step.done > span {
  background: var(--capsule);
}

.analysis-step strong {
  display: block;
  color: var(--ink);
}

.analysis-step small {
  color: var(--muted);
}

.candidate-panel,
.confirm-grid {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.candidate-panel > p,
.confirm-grid > p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.candidate {
  min-height: 48px;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
  color: var(--ink);
  background: var(--cream);
}

.candidate span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate.active {
  color: white;
  background: var(--capsule);
}

.confirm-block {
  padding: 12px;
  border-radius: 18px;
  background: var(--cream);
}

.confirm-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.component-list,
.portion-quick,
.sauce-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.component-chip,
.portion-chip,
.sauce-chip {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  background: #ece9d4;
  font-weight: 800;
}

.component-chip {
  min-height: 58px;
  display: grid;
  align-content: center;
  flex: 1 1 42%;
  gap: 2px;
  text-align: left;
}

.component-chip small {
  font-size: 0.72rem;
  color: inherit;
  opacity: 0.8;
}

.component-chip .chip-evidence {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.62;
}

.component-chip.active,
.portion-chip.active,
.sauce-chip.active {
  color: white;
  background: var(--capsule);
}

.confirm-note {
  margin: 0;
  color: var(--muted);
}

.analysis-actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 30;
  width: min(390px, calc(100% - 28px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  gap: 4px;
  padding: 8px;
  border-radius: 28px;
  background: rgba(240, 242, 217, 0.94);
  box-shadow: 0 16px 46px rgba(61, 59, 39, 0.16);
  backdrop-filter: blur(18px);
}

.is-camera-page .bottom-nav {
  display: none;
}

.nav-item,
.nav-scan {
  min-height: 52px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  gap: 2px;
  color: #8a9088;
  background: transparent;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.nav-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item small {
  font-size: 0.72rem;
  font-weight: 850;
}

.nav-item.active {
  color: var(--capsule);
}

.nav-scan {
  width: 58px;
  height: 58px;
  padding: 0;
  place-self: center;
  grid-column: 3;
  border-radius: 50%;
  color: white;
  background: var(--capsule);
  font-size: 1.4rem;
  box-shadow: 0 12px 26px rgba(231, 127, 63, 0.32);
}

@media (min-width: 760px) {
  .app-shell {
    width: min(100%, 920px);
  }

  .home-page,
  .records-page,
  .profile-page,
  .trends-page {
    width: 430px;
    margin: 0 auto;
  }

  .camera-page {
    width: 430px;
    margin: -28px auto 0;
  }
}

.home-v2 {
  min-height: calc(100vh - 136px);
  color: white;
}

.home-v2.active {
  display: block;
}

.home-v2-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0 16px;
}

.home-v2-hero h1 {
  margin: 0;
  color: white;
  font-size: 28px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.home-v2-hero h1 span {
  margin-left: 4px;
  font-size: 24px;
}

.home-v2-hero p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 300;
}

.home-bell {
  position: relative;
  width: 32px;
  height: 32px;
  margin-top: 4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: transparent;
}

.home-bell svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-bell i {
  position: absolute;
  right: 2px;
  top: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--capsule);
  border: 1px solid var(--bg);
}

.home-v2-stack {
  display: grid;
  gap: 16px;
}

.home-calorie-card,
.home-tools,
.today-record-card {
  border-radius: 24px;
  background: #f5f5ec;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.home-calorie-card {
  padding: 20px;
  color: #313329;
}

.home-calorie-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 22px;
  align-items: center;
}

.calorie-ring-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  display: grid;
  place-items: center;
}

.calorie-ring-svg {
  position: absolute;
  inset: 0;
}

.ring-track,
.ring-value {
  fill: none;
  stroke-width: 10;
}

.ring-track {
  stroke: #dce0d3;
}

.ring-value {
  stroke: #708354;
  stroke-linecap: round;
  stroke-dasharray: 377;
  stroke-dashoffset: 110;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 700ms ease;
}

.ring-copy {
  position: relative;
  z-index: 1;
  text-align: center;
}

.ring-copy p,
.ring-copy small,
.ring-copy em {
  display: block;
  margin: 0;
  color: #8f9387;
  font-style: normal;
}

.ring-copy p {
  margin-bottom: 3px;
  font-size: 0.72rem;
}

.ring-copy strong {
  display: block;
  font-size: 2.04rem;
  line-height: 1;
  font-weight: 940;
}

.ring-copy small,
.ring-copy em {
  margin-top: 4px;
  font-size: 0.66rem;
}

.macro-panel {
  display: grid;
  align-self: stretch;
  align-content: space-evenly;
  gap: 10px;
  min-width: 0;
}

.macro-progress {
  display: grid;
  gap: 6px;
}

.macro-progress div {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  font-size: 0.74rem;
}

.macro-progress b {
  min-width: 0;
  overflow: hidden;
  color: #313329;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.macro-progress strong {
  color: #313329;
  font-size: 0.74rem;
  font-weight: 850;
}

.macro-progress small {
  color: rgba(143, 147, 135, 0.62);
  font-size: 0.64rem;
  font-weight: 700;
}

.macro-progress > i {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce0d3;
}

.macro-progress > i span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #708354;
}

.macro-icon {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(112, 131, 84, 0.16);
  color: #708354;
  font-size: 0.7rem;
}

.macro-icon.grain {
  background: rgba(181, 128, 35, 0.16);
  color: #a97424;
}

.macro-icon.drop {
  background: rgba(218, 166, 50, 0.18);
  color: #c28a24;
}

.calorie-left-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0 0 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(210, 213, 199, 0.8);
  color: #313329;
  font-size: 0.88rem;
}

.calorie-left-row strong {
  color: var(--capsule);
  font-size: 1rem;
}

.home-photo-card {
  position: relative;
  min-height: 110px;
  overflow: hidden;
  border-radius: 24px;
  display: flex;
  align-items: center;
  padding: 20px;
  background: #899772;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.home-photo-card > div:first-child {
  position: relative;
  z-index: 2;
  width: 54%;
}

.home-photo-card h2 {
  margin-bottom: 4px;
  color: white;
  font-size: 1.25rem;
  line-height: 1.15;
}

.home-photo-card p {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
}

.photo-trigger {
  min-height: 31px;
  border-radius: 999px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: white;
  background: var(--capsule);
  box-shadow: 0 10px 20px rgba(184, 90, 37, 0.22);
  font-size: 0.76rem;
  font-weight: 850;
}

.photo-trigger svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.photo-card-art {
  position: absolute;
  right: -28px;
  top: 50%;
  width: 198px;
  height: 198px;
  transform: translateY(-50%);
  border-radius: 50%;
}

.photo-card-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(90deg, #899772 0%, rgba(137, 151, 114, 0.26) 42%, transparent 78%);
}

.photo-card-art img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.9;
  filter: saturate(0.86) contrast(0.95);
  transform: scale(0.75);
}

.scan-corner {
  position: absolute;
  z-index: 3;
  width: 18px;
  height: 18px;
  border-color: rgba(255, 255, 255, 0.92);
}

.scan-corner.a { left: 42px; top: 42px; border-left: 2px solid; border-top: 2px solid; }
.scan-corner.b { right: 42px; top: 42px; border-right: 2px solid; border-top: 2px solid; }
.scan-corner.c { left: 42px; bottom: 42px; border-left: 2px solid; border-bottom: 2px solid; }
.scan-corner.d { right: 42px; bottom: 42px; border-right: 2px solid; border-bottom: 2px solid; }

.home-tools {
  padding: 20px 12px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
}

.home-tools button {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: #313329;
  background: transparent;
}

.home-tools span {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #708354;
  background: #e8eadf;
  font-size: 1.14rem;
  font-weight: 900;
}

.home-tools span svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-tools .tool-hot {
  color: white;
  background: var(--capsule);
  font-size: 0.9rem;
}

.home-tools small {
  max-width: none;
  color: #313329;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  transform: scale(0.94);
  transform-origin: center;
}

.today-record-card {
  padding: 20px;
  color: #313329;
}

.home-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.home-section-title h2 {
  margin: 0;
  font-size: 1rem;
}

.home-section-title button {
  color: #8f9387;
  background: transparent;
  font-size: 0.74rem;
  font-weight: 760;
}

.today-record-card article {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  border-bottom: 1px solid rgba(210, 213, 199, 0.76);
}

.today-record-card article:last-child {
  border-bottom: 0;
}

.meal-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.86rem;
}

.meal-dot.breakfast { color: #d99a2b; background: #fff1ca; }
.meal-dot.lunch { color: #d97836; background: #fee1c8; }
.meal-dot.dinner { color: #6f736b; background: #e3e4dc; }

.today-record-card h3 {
  margin: 0 0 3px;
  font-size: 0.88rem;
}

.today-record-card h3 small {
  margin-left: 6px;
  color: #8f9387;
  font-size: 0.64rem;
  font-weight: 650;
}

.today-record-card p {
  max-width: 170px;
  margin: 0;
  overflow: hidden;
  color: #8f9387;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-record-card strong {
  color: #313329;
  font-size: 1rem;
}

.today-record-card strong small {
  margin-left: 2px;
  font-size: 0.62rem;
}

.today-record-card .meal-empty-value,
.record-food-card .meal-empty-value {
  color: #9a9f94;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.streak-card {
  min-height: 116px;
  border-radius: 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 20px;
  background: #899772;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.streak-card p,
.streak-card small {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.7rem;
}

.streak-card h2 {
  margin: 4px 0;
  color: white;
  font-size: 1.36rem;
}

.week-strip {
  min-height: 66px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  background: #f5f5ec;
}

.week-strip span {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: #313329;
  font-size: 0.62rem;
  font-weight: 800;
}

.week-strip b {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: #7a8c64;
  font-size: 0.64rem;
}

.week-strip .today b {
  background: var(--capsule);
}

.week-strip .today b::after {
  content: "";
  width: 10px;
  height: 10px;
  border: 1px solid white;
  border-radius: 50%;
}

.week-strip em {
  color: #313329;
  font-style: normal;
  font-size: 0.78rem;
}

body:not(.is-camera-page) .bottom-nav {
  bottom: 0;
  width: min(430px, 100%);
  min-height: 80px;
  padding: 9px 10px 12px;
  border-radius: 30px 30px 0 0;
  background: #f5f5ec;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

body:not(.is-camera-page) .nav-scan {
  transform: translateY(-22px);
  border: 4px solid var(--bg);
}

body:not(.is-camera-page) .nav-scan .nav-icon,
body:not(.is-camera-page) .nav-scan .nav-icon svg {
  width: 26px;
  height: 26px;
}

body:not(.is-camera-page) .nav-scan .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  line-height: 0;
}

body:not(.is-camera-page) .nav-scan .nav-icon svg {
  display: block;
  margin: 0;
}

body:not(.is-camera-page) .nav-scan .nav-icon svg {
  stroke-width: 2.4;
}

body:not(.is-camera-page) .nav-item.active {
  color: var(--capsule);
}

@media (max-width: 380px) {
  .home-calorie-card {
    grid-template-columns: 126px 1fr;
    gap: 14px;
    padding: 18px;
  }

  .calorie-ring-wrap,
  .calorie-ring-svg {
    width: 126px;
    height: 126px;
  }

  .home-tools {
    gap: 4px;
  }

  .home-tools span {
    width: 36px;
    height: 36px;
  }
}

/* Reference-shell pages: records, trends, profile */
.shell-page {
  min-height: calc(100vh - 108px);
  margin: -12px -4px 0;
  padding: 0 0 18px;
  color: #313329;
  background: #f7f8f3;
}

.records-page.shell-page,
.trends-page.shell-page {
  padding: 0 0 96px;
}

.records-page.shell-page {
  padding-bottom: 72px;
}

.trends-page.shell-page {
  padding-bottom: 72px;
}

.shell-page button {
  color: inherit;
}

.shell-top {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 8px;
}

.shell-top > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.shell-top h1 {
  margin: 0;
  color: #313329;
  font-size: 20px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0;
}

.shell-back {
  width: 26px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #313329;
  background: transparent;
  font-size: 28px;
  line-height: 1;
}

.shell-link,
.shell-icon-button {
  min-height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}

.shell-link.accent {
  color: #dd6b45;
}

.shell-icon-button {
  width: 32px;
  color: #313329;
  font-size: 20px;
}

.mini-icon {
  font-size: 14px;
  line-height: 1;
}

.shell-card {
  margin: 0 16px 16px;
  border-radius: 24px;
  background: #fbfbfa;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.035);
}

.shell-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shell-section-head h2 {
  margin: 0;
  color: #313329;
  font-size: 14px;
  font-weight: 800;
}

.shell-section-head button {
  border-radius: 999px;
  padding: 5px 11px;
  color: #dd6b45;
  background: rgba(221, 107, 69, 0.1);
  font-size: 12px;
  font-weight: 650;
}

.record-date-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 18px 18px;
  color: #313329;
  font-size: 18px;
}

.record-date-line .mini-icon,
.record-date-line span:last-child {
  color: #8f9387;
}

.record-date-line strong {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0;
}

.record-date-line .date-icon {
  width: 22px;
  height: 22px;
}

.record-date-line .date-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.record-dashboard {
  min-height: 214px;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
  padding: 26px 28px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.68) 42%, rgba(247, 247, 239, 0.74) 100%),
    #fbfaf2;
  box-shadow: 0 14px 34px rgba(77, 88, 64, 0.09);
}

.record-ring {
  position: relative;
  width: 140px;
  height: 140px;
  text-align: center;
}

.record-ring svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.record-ring circle {
  fill: none;
  stroke-width: 9;
}

.record-ring .track {
  stroke: rgba(120, 137, 96, 0.13);
}

.record-ring .value {
  stroke: #788960;
  stroke-linecap: round;
  stroke-dasharray: 289;
  stroke-dashoffset: 80;
}

.record-ring-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
}

.record-ring-copy span,
.record-ring-copy small {
  color: #313329;
  font-size: 13px;
  font-weight: 500;
}

.record-ring-copy strong {
  color: #030504;
  font-size: 36px;
  line-height: 1;
  font-weight: 900;
}

.record-stats {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.record-triplet {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  text-align: center;
}

.record-triplet small {
  display: block;
  margin-bottom: 8px;
  color: #313329;
  font-size: 13px;
  font-weight: 550;
}

.record-triplet b {
  display: block;
  color: #313329;
  font-size: 24px;
  line-height: 1;
  font-weight: 850;
}

.record-triplet div:first-child b,
.record-triplet div:last-child b {
  color: #788960;
}

.thin-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(120, 137, 96, 0.15);
}

.thin-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #788960;
  transition: width 0.35s ease;
}

.record-macros {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  color: #5d6159;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.record-macros span {
  min-width: 0;
  display: block;
  white-space: nowrap;
}

.record-macros b {
  color: #030504;
  font-size: 16px;
  font-weight: 850;
}

.macro-badge {
  width: 12px;
  height: 12px;
  margin-right: 5px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -1px;
  background: currentColor;
}

.macro-badge.protein {
  color: #788960;
  clip-path: ellipse(42% 50% at 50% 50%);
}

.macro-badge.carb {
  color: #de9d2d;
}

.macro-badge.fat {
  color: #8e9a76;
  border-radius: 65% 65% 65% 12%;
  transform: rotate(45deg);
}

.macro-badge.fiber {
  color: #788960;
  clip-path: ellipse(36% 50% at 50% 50%);
}

.meal-switch {
  margin: 0 18px 22px;
  padding: 0;
  display: grid;
  grid-template-columns: 1.24fr repeat(3, 1fr);
  gap: 12px;
  border-radius: 999px;
  background: transparent;
}

.meal-switch button {
  min-height: 58px;
  border-radius: 999px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #575a55;
  background: transparent;
  font-weight: 500;
}

.meal-switch span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
}

.meal-switch i {
  display: inline-block;
  width: 20px;
  color: currentColor;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  text-align: center;
}

.meal-switch b {
  color: currentColor;
  font-size: 18px;
  line-height: 1;
  font-weight: 780;
}

.meal-switch button.active {
  color: white;
  background: #788960;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(83, 96, 66, 0.2);
}

.meal-switch button.active i {
  color: #ffd45f;
}

.meal-switch small {
  font-size: 13px;
  font-weight: 450;
  opacity: 0.82;
}

@media (max-width: 430px) {
  .record-date-line {
    margin: 0 16px 14px;
    gap: 8px;
  }

  .record-date-line strong {
    font-size: 17px;
  }

  .record-dashboard {
    min-height: 188px;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 16px;
    margin-inline: 14px;
    padding: 22px 16px;
  }

  .record-ring {
    width: 112px;
    height: 112px;
  }

  .record-ring circle {
    stroke-width: 8;
  }

  .record-ring-copy {
    gap: 7px;
  }

  .record-ring-copy span,
  .record-ring-copy small {
    font-size: 13px;
  }

  .record-ring-copy strong {
    font-size: 30px;
  }

  .record-stats {
    gap: 16px;
  }

  .record-triplet {
    gap: 10px;
  }

  .record-triplet small {
    font-size: 11px;
  }

  .record-triplet b {
    font-size: 20px;
  }

  .record-macros {
    gap: 4px;
    font-size: 9px;
    line-height: 1.48;
  }

  .record-macros b {
    font-size: 15px;
  }

  .macro-badge {
    width: 8px;
    height: 8px;
    margin-right: 2px;
  }

  .meal-switch {
    margin-inline: 16px;
    gap: 7px;
  }

  .meal-switch button {
    min-height: 58px;
    gap: 5px;
  }

  .meal-switch span {
    gap: 5px;
  }

  .meal-switch i {
    width: 16px;
    font-size: 16px;
  }

  .meal-switch b {
    font-size: 15px;
  }

  .meal-switch small {
    font-size: 12px;
  }
}

/* Records page: tuned against docs/其他页.html and the reference visual. */
.records-page .record-date-line {
  gap: 6px;
  margin: 0 16px 16px;
  font-size: 14px;
}

.records-page .record-date-line .date-icon {
  width: 17px;
  height: 17px;
}

.records-page .record-date-line strong {
  font-size: 14px;
  font-weight: 800;
}

.records-page .record-dashboard {
  min-height: 142px;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin: 0 16px 16px;
  padding: 16px;
  border-radius: 24px;
  background: #fbfbfa;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.035);
}

.records-page .record-ring {
  width: 110px;
  height: 110px;
}

.records-page .record-ring circle {
  stroke-width: 7;
}

.records-page .record-ring .track {
  stroke: #e6eadf;
}

.records-page .record-ring .value {
  stroke: #7a8c64;
}

.records-page .record-ring-copy {
  gap: 5px;
}

.records-page .record-ring-copy span,
.records-page .record-ring-copy small {
  color: #8f9387;
  font-size: 10px;
  font-weight: 500;
}

.records-page .record-ring-copy strong {
  color: #313329;
  font-size: 24px;
  font-weight: 800;
}

.records-page .record-stats {
  gap: 12px;
}

.records-page .record-triplet {
  gap: 4px;
}

.records-page .record-triplet small {
  margin-bottom: 4px;
  color: #8f9387;
  font-size: 10px;
  font-weight: 500;
}

.records-page .record-triplet b {
  font-size: 16px;
  font-weight: 800;
}

.records-page .record-triplet div:last-child b {
  color: #8f9387;
}

.records-page .thin-progress {
  height: 6px;
  background: #e6eadf;
}

.records-page .thin-progress span {
  background: #708354;
}

.records-page .record-macros {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  color: #8f9387;
  font-size: 10px;
  line-height: 1.2;
}

.records-page .record-macros span {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 2px;
  min-width: 0;
  white-space: nowrap;
}

.records-page .record-macros em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  color: #5f655a;
  font-style: normal;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.records-page .record-macros b,
.records-page .record-macros strong {
  display: block;
  color: #313329;
  font-size: 12px;
  line-height: 1;
  font-weight: 760;
}

.records-page .record-macros strong {
  color: #8f9387;
  font-weight: 520;
}

.records-page .record-macros small {
  display: block;
  width: 18px;
  height: 1px;
  margin: 1px 0;
  border-radius: 999px;
  background: #cfd4c6;
}

.records-page .macro-badge {
  width: 9px;
  height: 9px;
  margin-right: 2px;
}

.records-page .meal-switch {
  margin: 0 12px 14px;
  padding: 3px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  border-radius: 999px;
  background: rgba(229, 233, 223, 0.82);
  box-shadow: 0 10px 24px rgba(90, 101, 78, 0.08);
}

.records-page .meal-switch button {
  min-height: 38px;
  padding: 0 6px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 999px;
  color: #313329;
  font-weight: 650;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.records-page .meal-switch span {
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 2px;
  min-width: 0;
}

.records-page .meal-switch i {
  width: 15px;
  flex: 0 0 15px;
  color: #8f9387;
  font-size: 15px;
  line-height: 1;
  text-align: center;
  transition: color 0.18s ease, transform 0.18s ease;
}

.records-page .meal-switch i::before {
  content: attr(data-icon-off);
}

.records-page .meal-switch button.active i::before {
  content: attr(data-icon-on);
}

.records-page .meal-switch button[data-meal-slot="snack"] {
  gap: 9px;
}

.records-page .meal-switch b {
  font-size: 12px;
  line-height: 1;
  font-weight: 520;
}

.records-page .meal-switch small {
  color: inherit;
  font-size: 9px;
  line-height: 1;
  font-weight: 450;
  opacity: 0.82;
}

.records-page .meal-switch button.active {
  color: #fff;
  background: #708354;
  box-shadow: 0 8px 18px rgba(83, 96, 66, 0.2);
  transform: translateY(-1px);
}

.records-page .meal-switch button.active i {
  color: #ffd45f;
  transform: scale(1.04);
}

.record-food-card {
  padding: 16px;
}


.record-food-card article {
  min-height: 66px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #f0f0ed;
}

.record-food-card article:last-child {
  border-bottom: 0;
}

.record-food-card img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
}

.record-food-card h3 {
  margin: 0;
  color: #313329;
  font-size: 14px;
  font-weight: 800;
}

.record-food-card p,
.record-food-card small {
  display: block;
  margin: 3px 0 0;
  color: #8f9387;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.record-food-card article > strong {
  color: #313329;
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}

.record-food-card article > strong small {
  display: inline;
  color: #313329;
  font-size: 10px;
  font-weight: 450;
}

.ai-suggestion {
  min-height: 66px;
  margin: 0 16px 16px;
  border-radius: 20px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: #f0f2e8;
}

.ai-suggestion > span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #708354;
  background: white;
  font-size: 13px;
  font-weight: 900;
}

.ai-suggestion h3 {
  margin: 0;
  color: #313329;
  font-size: 12px;
  font-weight: 800;
}

.ai-suggestion p {
  margin: 3px 0 0;
  color: #8f9387;
  font-size: 11px;
  line-height: 1.45;
}

.ai-suggestion button {
  border-radius: 999px;
  padding: 5px 11px;
  color: #dd6b45;
  background: white;
  border: 1px solid rgba(221, 107, 69, 0.18);
  font-size: 11px;
  font-weight: 800;
}

.ai-suggestion i {
  color: #8f9387;
  font-style: normal;
}

.trends-page .ai-suggestion {
  margin-bottom: 8px;
}

.wide-camera-button {
  width: calc(100% - 32px);
  min-height: 50px;
  margin: 0 16px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: white;
  background: #7a8c64;
  box-shadow: 0 10px 22px rgba(112, 131, 84, 0.24);
  font-size: 15px;
  font-weight: 700;
}

.records-page .wide-camera-button {
  margin-bottom: 8px;
  color: #fff;
}

.records-page .wide-camera-button span {
  color: inherit;
}

.trend-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 16px 16px;
}

.trend-filter > div {
  width: 208px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-radius: 999px;
  background: rgba(229, 233, 223, 0.8);
}

.trend-filter button {
  min-height: 28px;
  border-radius: 999px;
  color: #313329;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}

.trend-filter .active {
  color: white;
  background: #7a8c64;
  font-weight: 800;
}

.trend-filter > button {
  color: #708354;
  background: #f0f2e8;
  padding: 0 11px;
  font-weight: 800;
  white-space: nowrap;
}

.trend-main-card {
  padding: 16px;
}

.trend-main-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.trend-main-head h2 {
  margin: 0;
  color: #313329;
  font-size: 12px;
  font-weight: 800;
}

.trend-main-head p {
  margin: 5px 0 0;
}

.trend-main-head p strong {
  color: #313329;
  font-size: 36px;
  line-height: 1;
  font-weight: 950;
}

.trend-main-head p span {
  margin-left: 4px;
  color: #8f9387;
  font-size: 12px;
}

.trend-main-head small {
  display: block;
  color: #8f9387;
  font-size: 11px;
}

.trend-main-head small b,
.trend-main-head a {
  color: #2b9b65;
  font-weight: 800;
}

.trend-main-head > div:last-child {
  text-align: right;
}

.trend-main-head em {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 10px;
  color: #313329;
  background: rgba(229, 233, 223, 0.7);
  font-size: 11px;
  font-style: normal;
  font-weight: 650;
}

.trend-main-head > div:last-child small {
  margin-top: 12px;
}

.trend-main-head > div:last-child strong {
  display: block;
  color: #313329;
  font-size: 14px;
}

.trend-main-head > div:last-child strong span {
  font-size: 10px;
  font-weight: 450;
}

.trend-main-head a {
  display: block;
  margin-top: 2px;
  font-size: 10px;
}

.trend-svg-wrap {
  height: 176px;
  margin-top: 12px;
}

.trend-svg-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.trend-svg-wrap line {
  stroke: #f1f3ee;
}

.trend-svg-wrap text {
  fill: #bfbfc3;
  font-size: 9px;
  text-anchor: middle;
}

.trend-svg-wrap text:first-of-type,
.trend-svg-wrap text:nth-of-type(2),
.trend-svg-wrap text:nth-of-type(3) {
  text-anchor: start;
}

.trend-svg-wrap text.trend-empty-message {
  text-anchor: middle;
  dominant-baseline: middle;
}

.trend-svg-wrap .area {
  fill: url(#trendSoftFill);
}

.trend-svg-wrap .solid,
.trend-svg-wrap .dash {
  fill: none;
  stroke: #7a8c64;
  stroke-width: 2;
}

.trend-svg-wrap .dash {
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}

.trend-svg-wrap .points circle,
.trend-svg-wrap .goal {
  fill: white;
  stroke: #7a8c64;
  stroke-width: 1.7;
}

.trend-svg-wrap rect {
  fill: #7a8c64;
}

.trend-svg-wrap .bubble {
  fill: white;
  font-size: 8px;
  font-weight: 800;
}

.trend-svg-wrap .goal-text {
  fill: #7a8c64;
  font-size: 8px;
  text-anchor: end;
}

[data-loading] {
  display: inline-block;
  min-height: 0.9em;
  border-radius: 999px;
  color: transparent !important;
  background: rgba(255, 255, 255, 0.28);
  vertical-align: middle;
}

.shell-card [data-loading] {
  background: #ecefe8;
}

[data-loading="metric"] {
  width: 58px;
}

[data-loading="name"] {
  width: 78px;
}

[data-loading="short"] {
  width: 34px;
}

.trend-four {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid #f0f0ed;
  text-align: center;
}

.trend-four span {
  display: block;
  color: #8f9387;
  font-size: 10px;
  white-space: nowrap;
  transform: scale(0.9);
}

.trend-four strong {
  display: block;
  margin-top: 4px;
  color: #313329;
  font-size: 14px;
  font-weight: 850;
}

.trend-four small {
  font-size: 9px;
  font-weight: 450;
}

.weight-list {
  padding: 16px;
}

.weight-list article {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #f0f0ed;
  color: #8f9387;
  font-size: 12px;
}

.weight-list article:last-child {
  border-bottom: 0;
}

.weight-list b {
  color: #313329;
  font-weight: 650;
}

.weight-list strong {
  color: #313329;
  font-size: 12px;
  font-weight: 850;
}

.weight-list small {
  margin-left: 8px;
  border-radius: 5px;
  padding: 2px 6px;
  color: #2b9b65;
  background: #ecf8ef;
  font-size: 10px;
}

.weight-list small.up {
  color: #dd6b45;
  background: #fff1e9;
}

.weight-list .weight-loading-row span,
.weight-list .weight-loading-row strong {
  height: 10px;
  border-radius: 999px;
  background: #ecefe8;
}

.weight-list .weight-loading-row span {
  width: 92px;
}

.weight-list .weight-loading-row strong {
  width: 62px;
}

.weight-list .weight-empty-row {
  justify-content: center;
  color: #9a9f94;
}

.profile-shell {
  margin-top: -28px;
  padding-bottom: 72px;
}

.profile-cover {
  padding: 18px 16px 12px;
  background: linear-gradient(180deg, #8c9e76 0%, #a6b792 52%, #f7f8f3 100%);
}

.profile-tool-row {
  display: flex;
  justify-content: flex-end;
  padding: 2px 0 8px;
}

.profile-tool-row button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: white;
  background: transparent;
  font-size: 22px;
}

.profile-user-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  color: white;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.65);
  background:
    radial-gradient(circle at 50% 34%, #ffe7d4 0 16%, transparent 17%),
    radial-gradient(circle at 50% 50%, #533b2a 0 28%, transparent 29%),
    linear-gradient(135deg, #f2c3a8, #6e8a54);
  box-shadow: 0 10px 22px rgba(49, 51, 41, 0.12);
}

.profile-user-row h1 {
  margin: 0;
  color: white;
  font-size: 20px;
  font-weight: 850;
}

.profile-user-row h1 span {
  display: inline-flex;
  margin-left: 6px;
  border-radius: 999px;
  padding: 2px 7px;
  color: white;
  background: rgba(224, 153, 43, 0.85);
  font-size: 10px;
  vertical-align: middle;
}

.profile-user-row p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.profile-user-row p b {
  color: #ffd166;
}

.profile-user-row > strong {
  font-size: 20px;
  opacity: 0.82;
}

.vip-card {
  min-height: 78px;
  margin-top: 20px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px;
  color: white;
  background: linear-gradient(90deg, #4e5442, #6c765d);
  box-shadow: 0 10px 24px rgba(49, 51, 41, 0.16);
}

.vip-card div {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 10px;
}

.vip-card span {
  grid-row: span 2;
  color: #ffd166;
  font-size: 24px;
}

.vip-card h2 {
  margin: 0;
  color: #ffe3a5;
  font-size: 14px;
  font-weight: 850;
}

.vip-card p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  white-space: nowrap;
}

.vip-card button {
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  color: #4e5442;
  background: #fff0bf;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.profile-data {
  margin: 12px 6px 16px;
  padding: 16px 18px;
  border-radius: 26px;
}

.profile-data > div:last-child {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  text-align: center;
}

.profile-data article {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 0 8px;
  border-right: 1px solid #f0f0ed;
}

.profile-data article:last-child {
  border-right: 0;
}

.profile-data span {
  color: #8f9387;
  font-size: 18px;
}

.profile-data .profile-data-icon {
  width: 34px;
  height: 34px;
  margin: 0 auto 1px;
  display: block;
  background-image: url("./assets/profile/profile-data-icons-v1.png");
  background-repeat: no-repeat;
  background-size: 200% 200%;
  filter: drop-shadow(0 3px 5px rgb(70 82 57 / 14%));
}

.profile-data-icon-current { background-position: 0 0; }
.profile-data-icon-target { background-position: 100% 0; }
.profile-data-icon-energy { background-position: 0 100%; }
.profile-data-icon-exercise { background-position: 100% 100%; }

.profile-data small,
.profile-data b {
  color: #8f9387;
  font-size: 10px;
  font-weight: 450;
  white-space: nowrap;
}

.profile-data strong {
  color: #313329;
  font-size: 15px;
  font-weight: 850;
  white-space: nowrap;
}

.profile-data em {
  font-size: 9px;
  font-style: normal;
  font-weight: 450;
}

.profile-data article:first-child b,
.profile-data article:nth-child(2) b {
  color: #2b9b65;
}

#profile-weight-lost {
  display: block;
  width: 100%;
  text-align: center;
}

.profile-functions {
  padding: 16px;
}

.profile-functions h2 {
  margin: 0 0 16px;
  color: #313329;
  font-size: 14px;
  font-weight: 850;
}

.profile-functions > div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 20px;
  text-align: center;
}

.profile-functions button {
  display: grid;
  justify-items: center;
  gap: 6px;
  background: transparent;
}

.profile-functions span {
  color: #708354;
  font-size: 24px;
  line-height: 1;
}

.profile-functions small {
  color: #313329;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  transform: scale(0.9);
}

.profile-menu {
  margin-bottom: 8px;
  padding: 4px 16px;
}

.profile-menu button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f0f0ed;
  color: #313329;
  background: transparent;
  font-size: 14px;
  font-weight: 650;
}

.profile-menu button:last-child {
  border-bottom: 0;
}

.profile-menu small {
  color: #8f9387;
}

.profile-menu i {
  width: 6px;
  height: 6px;
  margin-left: 4px;
  border-radius: 50%;
  display: inline-block;
  background: #dd6b45;
  vertical-align: middle;
}

@media (min-width: 760px) {
  .shell-page {
    width: 430px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Uploaded-photo scan flow inspired by the supplied scan HTML. */
.camera-analyzing,
.camera-revealing,
.camera-review {
  background: #151613;
}

.camera-analyzing .camera-frame,
.camera-revealing .camera-frame,
.camera-review .camera-frame {
  height: 50dvh;
  min-height: 356px;
  margin: 0 0 0;
  border-radius: 0 0 32px 32px;
  background: #090a08;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.36);
}

.camera-analyzing .camera-frame img,
.camera-revealing .camera-frame img,
.camera-review .camera-frame img {
  filter: brightness(0.86) saturate(1.08);
  transform: scale(0.98);
}

.camera-analyzing .scan-beam-live,
.camera-revealing .scan-beam-live {
  height: 3px;
  top: 0;
  background: linear-gradient(90deg, transparent, #8ce61a, transparent);
  box-shadow: 0 0 18px #8ce61a, 0 0 36px rgba(140, 230, 26, 0.45);
  animation: laserScan 2.5s linear infinite;
}

.camera-analyzing .scan-grid-live,
.camera-revealing .scan-grid-live {
  background-image:
    linear-gradient(rgba(140, 230, 26, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 230, 26, 0.12) 1px, transparent 1px);
  background-size: 44px 44px;
}

.camera-analyzing .scan-dot-live,
.camera-revealing .scan-dot-live {
  width: 8px;
  height: 8px;
  background: #8ce61a;
  box-shadow: 0 0 8px #8ce61a, 0 0 20px rgba(140, 230, 26, 0.72);
}

@keyframes laserScan {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(calc(50dvh - 8px)); }
}

.camera-analyzing .corner,
.camera-revealing .corner,
.camera-review .corner {
  border-color: #8ce61a;
  filter: drop-shadow(0 0 10px rgba(140, 230, 26, 0.52));
}

.scan-progress {
  min-height: 240px;
  margin: 0 -14px;
  padding: 18px 20px 20px;
  align-content: start;
  gap: 9px;
  border-radius: 36px 36px 0 0;
  background: #1c1e18;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 0;
  border-right: 0;
  box-shadow: 0 -20px 46px rgba(0, 0, 0, 0.38);
}

.scan-ready-line {
  margin: 0 0 3px;
  color: rgba(255, 255, 255, 0.34);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-style: italic;
}

.camera-analyzing .scan-ready-line,
.camera-revealing .scan-ready-line,
.camera-review .scan-ready-line {
  display: none;
}

.scan-progress-line {
  min-height: 20px;
  color: #8cefa2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 650;
  white-space: nowrap;
}

.scan-progress-line::before {
  width: 5px;
  height: 5px;
  margin-right: 8px;
  background: #8ce61a;
  box-shadow: 0 0 10px rgba(140, 230, 26, 0.95);
}

.scan-progress-line span::after {
  background: #8cefa2;
}

.analysis-sheet {
  z-index: 50;
  align-items: flex-end;
  padding: 0;
  background: rgba(0, 0, 0, 0.75);
}

.analysis-card {
  width: min(100%, 430px);
  max-height: 78dvh;
  border-radius: 32px 32px 0 0;
  background: #f7f8f3;
  box-shadow: 0 -22px 54px rgba(0, 0, 0, 0.4);
}

.analysis-sheet.is-ready .analysis-card {
  max-height: 66dvh;
}

.analysis-content {
  padding: 22px 22px 24px;
}

.analysis-content .eyebrow {
  display: inline-flex;
  border-radius: 7px;
  padding: 3px 8px;
  color: #708354;
  background: rgba(112, 131, 84, 0.1);
  font-size: 12px;
  font-weight: 850;
}

.analysis-content h2 {
  margin: 10px 0 10px;
  color: #313329;
  font-size: 17px;
  font-weight: 950;
}

.candidate-panel > p,
.confirm-grid > p {
  color: #8f9387;
  font-size: 12px;
}

.candidate {
  min-height: 58px;
  border-radius: 18px;
  padding: 0 14px;
  color: #313329;
  background: #fbfbfa;
  border: 1px solid #eeeeea;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.035);
}

.candidate.active {
  color: #708354;
  background: #fbfbfa;
  border: 2px solid #7a8c64;
}

.candidate.active::after {
  content: "✓";
  margin-left: 8px;
  color: #7a8c64;
  font-weight: 950;
}

.confirm-block {
  border-radius: 18px;
  background: #fbfbfa;
  border: 1px solid #eeeeea;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.035);
}

.component-chip,
.portion-chip,
.sauce-chip {
  background: #f0f1eb;
}

.component-chip.active,
.portion-chip.active,
.sauce-chip.active {
  color: #708354;
  background: rgba(112, 131, 84, 0.1);
  border: 2px solid #7a8c64;
}

.analysis-actions {
  grid-template-columns: 1fr;
}

.secondary-action {
  display: none;
}

.primary-action {
  min-height: 48px;
  border-radius: 999px;
  color: white;
  background: #dd6b45;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.camera-result {
  background: #f7f8f3;
  color: #313329;
}

.camera-result .camera-frame {
  display: none;
}

.camera-result .camera-results {
  margin: -28px -14px 0;
  padding-bottom: 24px;
  gap: 14px;
}

.scan-report-top {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: #7a8c64;
  border-bottom: 1px solid rgba(245, 245, 236, 0.16);
  backdrop-filter: blur(14px);
}

.scan-report-top h2 {
  margin: 0;
  color: #f5f5ec;
  font-size: 16px;
  font-weight: 950;
}

.report-reset,
.report-done {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.report-reset {
  color: #f5f5ec;
  background: rgba(245, 245, 236, 0.16);
}

.report-done {
  color: #7a8c64;
  background: #f5f5ec;
}

.scan-report-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 16px;
  overflow: hidden;
  border-radius: 28px;
  background: #151613;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.scan-report-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
}

.anchor-dot {
  position: absolute;
  display: grid;
  justify-items: center;
  color: white;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
}

.anchor-protein {
  left: 38%;
  top: 35%;
}

.anchor-fat {
  left: 58%;
  top: 62%;
}

.anchor-dot i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #dd6b45;
  border: 2px solid white;
  box-shadow: 0 0 0 0 rgba(221, 107, 69, 0.8);
  animation: anchorPulse 1.5s ease infinite;
}

.anchor-fat i {
  background: #22a06b;
  box-shadow: 0 0 0 0 rgba(34, 160, 107, 0.8);
}

.anchor-dot b {
  max-width: 90px;
  margin-top: 6px;
  border-radius: 5px;
  padding: 2px 6px;
  overflow: hidden;
  color: white;
  background: rgba(0, 0, 0, 0.68);
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}

@keyframes anchorPulse {
  70% { box-shadow: 0 0 0 12px rgba(221, 107, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(221, 107, 69, 0); }
}

.macro-explosion-cards {
  margin: 0 16px;
}

.macro-explosion-cards > p {
  margin: 0 2px 8px;
  color: #8f9387;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.macro-explosion-cards > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.macro-explosion-cards article {
  min-height: 142px;
  border-radius: 18px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 14px 12px;
  background: white;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.04);
  border-bottom: 4px solid var(--macro-color, #7a8c64);
}

.macro-explosion-cards span {
  color: #8f9387;
  font-size: 10px;
  font-weight: 850;
}

.macro-explosion-cards strong {
  color: #313329;
  font-size: 20px;
  font-weight: 950;
}

.macro-explosion-cards i {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1f2ef;
}

.macro-explosion-cards em {
  display: block;
  width: var(--macro-width, 48%);
  height: 100%;
  border-radius: inherit;
  background: var(--macro-color, #7a8c64);
}

.macro-explosion-cards small {
  border-radius: 7px;
  padding: 3px 4px;
  color: var(--macro-color, #7a8c64);
  background: color-mix(in srgb, var(--macro-color, #7a8c64) 10%, white);
  font-size: 9px;
  font-weight: 750;
  text-align: center;
}

.macro-protein { --macro-color: #708354; }
.macro-carb { --macro-color: #dd6b45; }
.macro-fat { --macro-color: #7a6048; }

/* Hotfix: keep the recognition sheet usable and make the result report compact. */
.analysis-sheet .analysis-card {
  height: min(76dvh, 680px);
  max-height: min(76dvh, 680px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.analysis-sheet.is-ready .analysis-card {
  height: min(76dvh, 680px);
  max-height: min(76dvh, 680px);
}

.analysis-sheet .analysis-content {
  min-height: 0;
  max-height: min(76dvh, 680px);
  overflow-y: auto;
  padding-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

.analysis-sheet .component-chip {
  min-height: 46px;
  max-width: 100%;
  overflow: hidden;
}

.analysis-sheet .candidate {
  min-height: 50px;
}

.analysis-sheet .confirm-block {
  padding: 10px;
}

.analysis-sheet .component-chip span,
.analysis-sheet .component-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.analysis-sheet .analysis-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 16px -22px -16px;
  padding: 14px 22px max(18px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(247, 248, 243, 0), #f7f8f3 28%);
}

.camera-result .camera-results {
  min-height: 100dvh;
  padding-bottom: 18px;
  gap: 10px;
  background: #7a8c64;
}

.camera-result .scan-report-photo {
  aspect-ratio: 16 / 10;
  margin: 12px 16px 10px;
}

.camera-result .result-card {
  margin: 0 16px;
  padding: 16px;
  border-radius: 22px;
  background: #f5f5ec;
  border: 1px solid rgba(220, 224, 211, 0.95);
  box-shadow: 0 12px 26px rgba(49, 51, 41, 0.12);
}

.camera-result .result-title-row {
  grid-template-columns: 52px 1fr 54px;
  gap: 12px;
}

.camera-result .result-title-row img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.camera-result .result-title-row h2 {
  font-size: 16px;
  line-height: 1.18;
}

.camera-result .confidence {
  min-height: 46px;
  border-radius: 13px;
  color: #708354;
  background: rgba(112, 131, 84, 0.12);
}

.camera-result .nutrition-strip {
  margin-top: 12px;
  border-color: #e6eadf;
}

.camera-result .nutrition-strip div {
  min-height: 58px;
}

.camera-result .nutrition-strip span {
  color: #dd6b45;
  font-size: 18px;
}

.camera-result .nutrition-strip small {
  font-size: 10px;
}

.camera-result .range-copy {
  margin: 12px 0 0;
  color: #8f9387;
  font-size: 12px;
  line-height: 1.5;
}

.camera-result .macro-explosion-cards article {
  min-height: 112px;
  background: #f5f5ec;
  box-shadow: 0 12px 26px rgba(49, 51, 41, 0.12);
}

.camera-result .macro-explosion-cards > p {
  color: rgba(245, 245, 236, 0.9);
}

.camera-result .scan-report-photo {
  border: 1px solid rgba(245, 245, 236, 0.2);
  box-shadow: 0 16px 32px rgba(49, 51, 41, 0.22);
}

.camera-result .ingredient-detail,
.camera-result .soft-button,
.camera-result .credibility-panel,
.camera-result .question-panel,
.camera-result .explosion-module,
.camera-result .log-panel {
  display: none;
}
