/* ═══════════════════════════════════════════════════════════
   食算纪 Foodiary — 视觉层
   配色与排版取自「奶油蛋糕工坊」那种编辑杂志感：
   米纸底 · 高对比衬线标题 · 砖红细节点缀 · 极细分隔线 · 无卡片
   ═══════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'CrimsonPro';
  src: url('assets/fonts/CrimsonPro-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'CrimsonPro';
  src: url('assets/fonts/CrimsonPro-Italic.ttf') format('truetype');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'CrimsonPro';
  src: url('assets/fonts/CrimsonPro-Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'InstrumentSans';
  src: url('assets/fonts/InstrumentSans-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'InstrumentSans';
  src: url('assets/fonts/InstrumentSans-Italic.ttf') format('truetype');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'InstrumentSans';
  src: url('assets/fonts/InstrumentSans-Bold.ttf') format('truetype');
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  /* 纸 */
  --paper:    #EFE9E0;
  --paper-2:  #E8E1D5;
  --paper-3:  #F6F2EA;
  --paper-4:  #E2DACA;

  /* 墨：三级文字 + 装饰线。
     ink-3 = 5.97:1 / ink-4 = 5.03:1（在纸底上），都过 WCAG AA 4.5；
     ink-5 只做装饰（分隔线、进度槽、hover 下划线），不承担任何要读的信息。 */
  --ink:      #2B2622;
  --ink-2:    #4C443A;
  --ink-3:    #5F564A;
  --ink-4:    #6B6154;
  --ink-5:    #ADA294;

  /* 一点砖红，只做点缀 */
  --accent:   #9C3B36;
  --accent-l: #C0736C;

  /* 营养素 */
  --p:        #75865A;
  --c:        #C0954C;
  --f:        #A9544B;

  --line:     #D5CBBC;
  --line-2:   #E2DACB;

  --serif: 'CrimsonPro', 'Songti SC', 'STSong', 'SimSun', 'Source Han Serif SC',
           'Noto Serif SC', Georgia, serif;
  --sans: 'InstrumentSans', -apple-system, BlinkMacSystemFont, 'PingFang SC',
          'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;

  --gut: clamp(20px, 5vw, 72px);
  --maxw: 1240px;
}

* { box-sizing: border-box; }

/* 平滑滚动交给 JS（CSS 的 smooth 时长不可控，长距离能滚 3 秒） */
html { scroll-behavior: auto; }
section[id] { scroll-margin-top: 78px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  line-break: strict;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 极轻的纸纹，让它不像一块纯色屏幕 */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: .038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

::selection { background: var(--accent); color: var(--paper); }

/* ─────────── 通用文字零件 ─────────── */

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  line-height: 1;
  color: var(--accent);
  margin: 0 0 18px;
  text-transform: uppercase;
}

.micro {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .15em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin: 0;
}

/* Windows 的宋体在大字号下笔画偏细，补一点点厚度接近西文衬线的对比感 */
.opening__zh,
.h2,
.row__title,
.case__title,
.closing__line,
.wordmark__zh,
.fact__n,
.num__v {
  -webkit-text-stroke: .6px currentColor;
}

.h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 3.9vw, 54px);
  line-height: 1.14;
  letter-spacing: .01em;
  margin: 0 0 22px;
  color: var(--ink);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink);
  padding-bottom: 3px;
  border-bottom: 1px solid var(--ink-5);
  transition: color .25s, border-color .25s;
}
.link-arrow::after {
  content: '→';
  font-family: var(--serif);
  transition: transform .25s;
}
.link-arrow:hover { color: var(--accent); border-color: var(--accent); }
.link-arrow:hover::after { transform: translateX(3px); }

/* ─────────── 顶栏 ─────────── */

.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--line-2);
}

.topbar__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
  height: 62px;
  display: flex;
  align-items: center;
  gap: 40px;
}

.wordmark { display: flex; align-items: baseline; gap: 9px; }
.wordmark__zh {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: .06em;
}
.wordmark__en {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-3);
}

.topbar__nav {
  margin-left: auto;
  display: flex;
  gap: 30px;
}
.topbar__nav a {
  font-size: 12.5px;
  color: var(--ink-2);
  letter-spacing: .04em;
  position: relative;
  padding-bottom: 2px;
  transition: color .2s;
}
.topbar__nav a::after {
  content: '';
  position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: var(--accent);
  transition: right .28s ease;
}
.topbar__nav a:hover { color: var(--accent); }
.topbar__nav a:hover::after { right: 0; }

.topbar__folio {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--ink-4);
  padding-left: 26px;
  border-left: 1px solid var(--line-2);
}
.topbar__folio i { color: var(--line); font-style: normal; }

/* ─────────── 开篇 ─────────── */

.opening { padding: clamp(56px, 8vw, 108px) 0 0; }

.opening__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(30px, 5vw, 76px);
  align-items: center;
}

.opening__title {
  margin: 0 0 26px;
  font-weight: 400;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.opening__zh {
  font-family: var(--serif);
  font-size: clamp(54px, 7.6vw, 100px);
  line-height: 1;
  letter-spacing: .005em;
}
.opening__en {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(40px, 5.6vw, 74px);
  line-height: 1;
  color: var(--accent);
  letter-spacing: -.01em;
  padding-left: .06em;
}

.opening__lede,
.opening__note,
.stage__desc,
.ledger__desc,
.case__body,
.row__desc,
.closing__desc {
  text-wrap: pretty;
}

.opening__lede {
  font-size: clamp(16px, 1.35vw, 18.5px);
  line-height: 1.85;
  color: var(--ink-2);
  max-width: 26em;
  margin: 0 0 16px;
}

.opening__note {
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--ink-3);
  max-width: 30em;
  margin: 0 0 34px;
}

.opening__cta { display: flex; gap: 28px; flex-wrap: wrap; }

.opening__figure {
  margin: 0;
  justify-self: end;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(16px, 2vw, 28px);
  align-items: start;
  width: 100%;
  max-width: 520px;
}

.opening__phone {
  width: clamp(196px, 21vw, 264px);
  border-radius: 14px;
  overflow: hidden;
  transform: rotate(-1.6deg);
  box-shadow:
    0 40px 70px -34px rgba(43, 38, 34, .42),
    0 12px 26px -16px rgba(43, 38, 34, .22);
  transition: transform .8s cubic-bezier(.2, .7, .3, 1);
}
.opening__phone:hover { transform: rotate(0deg); }
.opening__phone img { width: 100%; filter: saturate(.9) contrast(1.02); }

.opening__figure figcaption {
  grid-column: 1 / -1;
  margin-top: 18px;
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--ink-4);
  text-align: right;
}

.facts {
  max-width: var(--maxw);
  margin: clamp(56px, 7vw, 92px) auto 0;
  padding: 26px var(--gut) 34px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.fact { display: flex; flex-direction: column; gap: 6px; }
.fact__n {
  font-family: var(--serif);
  font-size: clamp(32px, 3.4vw, 46px);
  line-height: 1;
  color: var(--ink);
  letter-spacing: -.01em;
}
.fact__l {
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--ink-3);
}

/* ─────────── 01 识膳体验 ─────────── */

.stage { padding: clamp(70px, 9vw, 132px) 0; }

.stage__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
  display: grid;
  grid-template-columns: 316px minmax(0, 1fr);
  gap: clamp(28px, 3.6vw, 56px);
  align-items: start;
}

.stage__side { position: sticky; top: 86px; }
/* sticky 元素不能用 transform 进场，否则会丢失粘性 —— 只淡入 */
.stage__side.reveal { transform: none; }
body.js-ready .stage__side.reveal { transform: none; transition: opacity .9s ease; }

.stage__desc {
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--ink-3);
  margin: 0 0 34px;
}

/* 素材选择器 —— 对应蛋糕游戏左侧那一排原料 */
.picker__head {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.picker__head span {
  letter-spacing: .04em;
  font-weight: 400;
  color: var(--ink-4);
  text-transform: none;
  font-size: 11px;
}

.picker__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 10px;
}

.picker__item {
  display: block;
  width: 100%;
  cursor: pointer;
  border: 0;
  padding: 0;
  background: none;
  text-align: center;
}

.picker__thumb {
  display: block;
  position: relative;
  aspect-ratio: 6 / 5;
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper-3);
  outline: 1px solid transparent;
  outline-offset: 3px;
  transition: outline-color .22s, transform .3s;
}
.picker__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.94) contrast(.98);
  transition: transform .6s cubic-bezier(.2,.7,.3,1), filter .3s;
}
.picker__item:hover .picker__thumb img { transform: scale(1.06); }
.picker__item:hover .picker__thumb { outline-color: var(--line); }
.picker__item.is-active .picker__thumb { outline-color: var(--accent); }
.picker__item.is-active .picker__thumb img { filter: none; }

.picker__label {
  display: block;
  margin-top: 8px;
  font-size: 9.5px;
  line-height: 1.4;
  color: var(--ink-3);
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .2s;
}
.picker__item:hover .picker__label,
.picker__item.is-active .picker__label { color: var(--ink); }

.picker__foot {
  margin: 20px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--ink-4);
  letter-spacing: .02em;
}

/* 主区：识别框 + 读数 */
.stage__main {
  display: grid;
  grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr);
  gap: clamp(20px, 2.6vw, 38px);
  align-items: stretch;
}

.frame {
  position: sticky;
  top: 96px;
  align-self: start;
  aspect-ratio: 2 / 3;
  background: var(--paper-3);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .3s, background .3s;
}
.frame:hover { border-color: var(--line); }
.frame.dragover { border-color: var(--accent); background: #F7F1E6; }
.frame.has-image { cursor: default; border-color: var(--line); }

.frame__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 24px;
  text-align: center;
}

.frame__plus {
  position: relative;
  width: 34px; height: 34px;
  margin-bottom: 14px;
}
.frame__plus::before,
.frame__plus::after {
  content: '';
  position: absolute;
  background: var(--ink-5);
  transition: background .3s, transform .3s;
}
.frame__plus::before { left: 50%; top: 0; width: 1px; height: 100%; transform: translateX(-50%); }
.frame__plus::after { top: 50%; left: 0; height: 1px; width: 100%; transform: translateY(-50%); }
.frame:hover .frame__plus::before,
.frame:hover .frame__plus::after { background: var(--accent); }

.frame__hint {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink-2);
  letter-spacing: .02em;
}
.frame__sub {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--ink-4);
  letter-spacing: .04em;
}

.frame__preview { width: 100%; height: 100%; }
.frame__preview img { width: 100%; height: 100%; object-fit: cover; }

.frame__scan {
  position: absolute; inset: 0;
  background: rgba(239, 233, 224, .82);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 26px;
  overflow: hidden;
}
.scanline {
  position: absolute;
  left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 20%, var(--accent) 80%, transparent);
  box-shadow: 0 0 18px 3px rgba(156, 59, 54, .32);
  animation: scan 1.6s cubic-bezier(.5,0,.5,1) infinite;
}
@keyframes scan {
  0%   { top: 6%;  opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { top: 94%; opacity: 0; }
}

.frame__status {
  position: relative;
  margin: 0;
  font-size: 11.5px;
  letter-spacing: .14em;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 600;
}

.frame__reset {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--paper);
  background: rgba(43, 38, 34, .78);
  padding: 6px 13px;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background .2s;
}
.frame__reset:hover { background: var(--accent); }

/* 读数面板 */
.readout {
  min-height: 220px;
  padding-top: 2px;
}

.ghost { margin-top: 2px; }

.ghost__row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.ghost__row span {
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--ink-4);
  white-space: nowrap;
}
.ghost__row i {
  flex: 1;
  height: 1px;
  border-bottom: 1px dotted var(--line);
  transform: translateY(-2px);
}
.ghost__hint {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-3);
  letter-spacing: .03em;
}

.readout__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-2);
}
.readout__schema { font-size: 11.5px; color: var(--ink-4); letter-spacing: .06em; }

/* 食物行 */
.foods { display: flex; flex-direction: column; }

.food {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-2);
  animation: riseIn .5s cubic-bezier(.2,.7,.3,1) backwards;
}
.food:nth-child(2) { animation-delay: .07s; }
.food:nth-child(3) { animation-delay: .14s; }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

.food__name {
  font-family: var(--serif);
  font-size: 18.5px;
  line-height: 1.35;
  color: var(--ink);
  letter-spacing: .01em;
}
.food__kcal {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.3;
  color: var(--ink);
  white-space: nowrap;
}
.food__kcal small {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--ink-4);
  margin-left: 3px;
}

.food__meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: .02em;
}
.food__meta b { font-weight: 600; color: var(--ink-2); }

/* 置信度 —— 细线，不用粗条 */
.conf {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 3px;
}
.conf__label {
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--ink-4);
  text-transform: uppercase;
  white-space: nowrap;
}
.conf__track {
  flex: 1;
  height: 1px;
  background: var(--line);
  position: relative;
}
.conf__fill {
  position: absolute; left: 0; top: -1px;
  height: 3px;
  background: var(--ink-2);
  transition: width 1s cubic-bezier(.2,.7,.3,1);
}
.conf__pct {
  font-family: var(--serif);
  font-size: 13.5px;
  color: var(--ink-2);
  min-width: 30px;
  text-align: right;
}

/* 合计 */
.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--ink);
}
.total span { font-size: 12.5px; letter-spacing: .06em; color: var(--ink-3); }
.total b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 34px;
  line-height: 1;
  color: var(--ink);
}
.total b small {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--ink-4);
  margin-left: 4px;
}

/* 三养分 */
.split { padding: 20px 0 4px; }
.split__head {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.split__head span {
  font-weight: 400; letter-spacing: .04em;
  text-transform: none; color: var(--ink-4); font-size: 11.5px;
}

.split__row + .split__row { margin-top: 13px; }
.split__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 6px;
  letter-spacing: .03em;
}
.split__meta em {
  font-family: var(--serif);
  font-style: normal;
  font-size: 14.5px;
  color: var(--ink-2);
}
.split__track { height: 2px; background: var(--line-2); }
.split__fill {
  height: 100%;
  width: 0;
  transition: width 1.05s cubic-bezier(.2,.7,.3,1);
}

/* 小算手回话 */
.voice {
  margin: 26px 0 0;
  padding: 2px 0 2px 16px;
  border-left: 1px solid var(--accent-l);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-2);
  letter-spacing: .01em;
}
.voice b {
  display: block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 7px;
}

/* ─────────── 02 / 03 编号列表 ─────────── */

.ledger { padding: 0 0 clamp(70px, 9vw, 130px); }
.ledger--cases { padding-top: 0; }

.ledger__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.ledger__head {
  max-width: 620px;
  margin-bottom: clamp(34px, 4.5vw, 58px);
}
.ledger__desc {
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--ink-3);
  margin: 0;
}

.rows { border-top: 1px solid var(--line); }

.row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 236px;
  gap: 0 28px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line-2);
}

.row__no {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-4);
  padding-top: 3px;
}

.row__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.4;
  margin: 0 0 7px;
  color: var(--ink);
  letter-spacing: .01em;
}

.row__desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-2);
  max-width: 46em;
}

.row__proof {
  margin: 0;
  padding-top: 4px;
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: .04em;
  color: var(--ink-4);
  text-align: right;
}

/* 取舍条目更厚 */
.row--case {
  grid-template-columns: 58px minmax(0, 1fr);
  padding: 34px 0 36px;
}

.case__tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.case__tag--p { color: var(--accent); }

.case__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(21px, 2vw, 26px);
  line-height: 1.42;
  margin: 0 0 14px;
  color: var(--ink);
  letter-spacing: .01em;
}

.case__body {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.95;
  color: var(--ink-2);
  max-width: 62em;
}

.case__result {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink);
  padding-left: 14px;
  border-left: 1px solid var(--accent-l);
}

/* ─────────── 04 档案 ─────────── */

.archive {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(64px, 8vw, 110px) 0;
}

.archive__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.archive__head { margin-bottom: clamp(36px, 4vw, 54px); }

.archive__nums {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.num { display: flex; flex-direction: column; gap: 7px; }
.num__v {
  font-family: var(--serif);
  font-size: clamp(44px, 5.2vw, 68px);
  line-height: 1;
  color: var(--ink);
  letter-spacing: -.015em;
}
.num__k { font-size: 11px; letter-spacing: .11em; color: var(--ink-3); }

.archive__cols {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(30px, 5vw, 70px);
  padding-top: 34px;
}
.archive__col .micro { margin-bottom: 16px; }

.stack {
  margin: 0;
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 2.1;
  color: var(--ink-2);
  letter-spacing: .01em;
}
.stack i { font-style: normal; color: var(--ink-4); margin: 0 3px; }

.duties {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: duty;
}
.duties li {
  position: relative;
  padding-left: 22px;
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--ink-2);
  margin-bottom: 10px;
  counter-increment: duty;
}
.duties li::before {
  content: counter(duty, decimal-leading-zero);
  position: absolute; left: 0; top: .18em;
  font-family: var(--serif);
  font-style: italic;
  font-size: 11px;
  color: var(--ink-4);
}

/* ─────────── 05 联系 ─────────── */

.closing { padding: clamp(76px, 10vw, 140px) 0; }

.closing__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.closing__line {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 1.42;
  letter-spacing: .01em;
  margin: 0 0 22px;
  color: var(--ink);
}
.closing__line em { font-style: italic; color: var(--accent); }

.closing__desc {
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--ink-3);
  margin: 0 0 34px;
  max-width: 34em;
}

.closing__links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 42px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

/* ─────────── 页脚 ─────────── */

.footer { border-top: 1px solid var(--line-2); padding: 30px 0 40px; }
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer p {
  margin: 0;
  font-size: 11px;
  line-height: 1.8;
  color: var(--ink-4);
  max-width: 56em;
  letter-spacing: .02em;
}
.footer__sign { letter-spacing: .06em; white-space: nowrap; }
.footer__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}
.footer__legal { font-size: 10px; letter-spacing: .08em; }
.footer__legal a {
  color: var(--ink-4);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .25s ease, border-color .25s ease;
}
.footer__legal a:hover { color: var(--ink-2); border-bottom-color: var(--line-2); }

/* ─────────── 进场 ─────────── */

.reveal {
  transition: opacity .8s cubic-bezier(.2,.7,.3,1), transform .8s cubic-bezier(.2,.7,.3,1);
}
body.js-ready .reveal {
  opacity: 0;
  transform: translateY(14px);
}
body.js-ready .reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ─────────── 响应式 ─────────── */

@media (max-width: 1080px) {
  .stage__inner { grid-template-columns: 1fr; }
  .stage__side { position: static; }
  .picker__grid { grid-template-columns: repeat(5, 1fr); max-width: 460px; }
  .stage__desc { max-width: 46em; }
}

@media (max-width: 900px) {
  .opening__inner { grid-template-columns: 1fr; gap: 46px; }
  .opening__figure { justify-self: start; }
  .opening__phone { width: 210px; }
  .opening__figure figcaption { text-align: left; }
  .facts { grid-template-columns: repeat(3, 1fr); row-gap: 30px; }
  .row { grid-template-columns: 42px minmax(0, 1fr); }
  .row__proof { grid-column: 2; text-align: left; padding-top: 10px; }
  .archive__cols { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .topbar__nav { display: none; }
  .topbar__folio { margin-left: auto; border: 0; padding-left: 0; }
  .stage__main { grid-template-columns: 1fr; }
  .frame { aspect-ratio: 4 / 3; }
  .chamber { aspect-ratio: 4 / 3; }
  .picker__grid { grid-template-columns: repeat(3, 1fr); max-width: none; gap: 12px 8px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .archive__nums { grid-template-columns: 1fr; gap: 20px; }
  .archive__nums .num { flex-direction: row; align-items: baseline; gap: 14px; }
  .archive__nums .num__v { font-size: 38px; }
  .row--case { grid-template-columns: 1fr; }
  .row--case .row__no { margin-bottom: 12px; padding-top: 0; }
  .footer__inner { flex-direction: column; gap: 12px; }
  .footer__meta { align-items: flex-start; text-align: left; }
}

/* ═══════════════════════════════════════════════════════════
   02 建档 · 03 食谱 —— 后续新增模块
   ═══════════════════════════════════════════════════════════ */

.fact__n small {
  font-family: var(--sans);
  font-size: .38em;
  letter-spacing: .04em;
  color: var(--ink-3);
  margin-left: 2px;
}

/* 区块底色分隔 */
.stage--tint {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ─────────── 小人选择器 ─────────── */

.avatars {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 8px;
  margin: 0 -4px;
}

.avatars .avatar {
  width: calc(20% - 7px);
}

.avatar {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  text-align: center;
  cursor: grab;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}
.avatar:active { cursor: grabbing; }

.avatar__art {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 264 / 470;
  border-radius: 4px;
  background: transparent;
  outline: 1px solid transparent;
  outline-offset: 2px;
  transition: outline-color .22s, background .25s;
  overflow: hidden;
}
.avatar__art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  transition: transform .5s cubic-bezier(.2,.7,.3,1);
}
.avatar:hover .avatar__art { outline-color: var(--line); background: var(--paper-3); }
.avatar:hover .avatar__art img { transform: translateY(-2px); }
.avatar.is-active .avatar__art {
  outline-color: var(--accent);
  background: var(--paper-3);
}
.avatar.is-active .avatar__name { color: var(--accent); }

.avatar__name {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--ink-2);
  transition: color .2s;
}
.avatar__meta {
  display: block;
  margin-top: 1px;
  font-size: 9.5px;
  letter-spacing: -.01em;
  color: var(--ink-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─────────── 体检仓 ─────────── */

.chamber {
  position: relative;
  aspect-ratio: 2 / 3;
  max-width: 100%; /* 防止建档后报告变高把仓体按比例撑宽、盖住右侧面板 */
  border: 1px solid var(--line);
  border-radius: 3px;
  background:
    radial-gradient(circle at 50% 52%, #EFE7D9 0%, #E3DAC9 62%, #DDD3C0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .3s, background .3s;
}
.chamber:hover { border-color: var(--ink-4); }
.chamber.dragover {
  border-color: var(--accent);
  background: #F7F1E6;
}
.chamber.has-figure { cursor: default; }

/* 仓体刻度环 */
.chamber__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px dashed #B5A78F;
  border-radius: 50%;
  pointer-events: none;
}
.chamber__ring::before,
.chamber__ring::after {
  content: "";
  position: absolute;
  background: #B5A78F;
}
.chamber__ring::before { left: 50%; top: -10px; width: 1px; height: 10px; }
.chamber__ring::after { left: 50%; bottom: -10px; width: 1px; height: 10px; }

.chamber__empty {
  position: relative;
  text-align: center;
  padding: 20px;
}
.chamber__hint {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink-2);
  letter-spacing: .02em;
}
.chamber__sub {
  margin: 4px 0 0;
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--ink-4);
  text-transform: uppercase;
}

.chamber__figure {
  position: relative;
  width: 54%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: figureIn .6s cubic-bezier(.2,.7,.3,1);
}
.chamber__figure img {
  width: 100%;
  height: auto;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
}

@keyframes figureIn {
  from { opacity: 0; transform: translateY(14px) scale(.94); }
  to   { opacity: 1; transform: none; }
}

.chamber__scan {
  position: absolute;
  inset: 0;
  background: rgba(232, 225, 213, .78);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 24px;
  overflow: hidden;
}
.chamber__beam {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 15%, var(--accent) 85%, transparent);
  box-shadow: 0 0 22px 4px rgba(156, 59, 54, .3);
  animation: beam 1.5s cubic-bezier(.5,0,.5,1) infinite;
}
@keyframes beam {
  0%   { bottom: 4%;  opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { bottom: 92%; opacity: 0; }
}

/* ─────────── 体检报告 ─────────── */

.gauges {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--line-2);
  padding: 16px 0 18px;
}

.gauge {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 12px;
}
.gauge + .gauge {
  padding-left: 14px;
  border-left: 1px solid var(--line-2);
}

.gauge__k {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.gauge__v {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -.01em;
}
.gauge__v small {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--ink-4);
  margin-left: 3px;
}

.gauge__sub,
.gauge__tag {
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--ink-4);
}

.gauge--lead .gauge__v { font-size: 40px; line-height: 1; }
.gauge__tag {
  align-self: flex-start;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
}
.tone-ok   .gauge__tag { color: #6D7F52; }
.tone-low  .gauge__tag { color: #8A7A5E; }
.tone-high .gauge__tag { color: #A8773C; }
.tone-bad  .gauge__tag { color: var(--accent); }

.btn-more {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 12px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--ink);
  background: transparent;
  transition: background .22s, color .22s;
}
.btn-more:hover { background: var(--ink); color: var(--paper); }

/* ─────────── 03 食谱 ─────────── */

.stage__main--wide {
  display: block;
}

.menu-ctrl { margin-top: 4px; }

.goals {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.goal {
  flex: 1;
  padding: 8px 4px;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  transition: all .2s;
}
.goal:hover { border-color: var(--ink-4); color: var(--ink-2); }
.goal.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.menu-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-2);
}

.dishes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px 26px;
  padding-top: 26px;
}

.dishes__idle {
  grid-column: 1 / -1;
  padding: 48px 0 52px;
  text-align: center;
}
.dishes__idle-txt {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink-3);
  letter-spacing: .02em;
}

.btn-generate {
  padding: 12px 30px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--ink);
  background: transparent;
  transition: background .22s, color .22s;
}
.btn-generate:hover { background: var(--ink); color: var(--paper); }

.dish {
  animation: dishIn .55s cubic-bezier(.2,.7,.3,1) backwards;
}
@keyframes dishIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.dish__img {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 3px;
  background: var(--paper-3);
}
.dish__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.94) contrast(.98);
  transition: transform .7s cubic-bezier(.2,.7,.3,1);
}
.dish:hover .dish__img img { transform: scale(1.04); }

.dish__score {
  position: absolute;
  right: 10px;
  top: 10px;
  min-width: 34px;
  padding: 3px 8px;
  text-align: center;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.2;
  color: var(--paper);
  background: rgba(43, 38, 34, .8);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.dish__body { padding-top: 13px; }

.dish__name {
  margin: 0 0 5px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: .01em;
  color: var(--ink);
}

.dish__why {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-3);
}

.dish__macro {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding-top: 9px;
  border-top: 1px solid var(--line-2);
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--ink-4);
}
.dish__macro b {
  font-weight: 600;
  color: var(--ink-2);
  font-size: 11.5px;
}

/* 食谱区：直接切体质（不然「五套菜」根本看不见） */
.picker__examples {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin: 14px 0 0;
}

.ex-avatar {
  padding: 0 0 1px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--ink-3);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.ex-avatar:hover { color: var(--accent); border-bottom-color: var(--accent); }
.ex-avatar.is-on { color: var(--accent); border-bottom-color: var(--accent); }

/* 食谱卡里的「食材 · 做法」：原生 details，file:// 也能用 */
.dish__rec {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px dotted var(--line-2);
}

.dish__rec summary {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--ink-4);
  transition: color .2s;
}
.dish__rec summary::-webkit-details-marker { display: none; }
.dish__rec summary::before {
  content: '+';
  width: 9px;
  font-size: 12px;
  line-height: 1;
  color: var(--accent);
}
.dish__rec[open] summary::before { content: '\2212'; }
.dish__rec summary:hover { color: var(--ink-2); }

.dish__ing {
  margin: 10px 0 7px;
  font-size: 11.5px;
  line-height: 1.85;
  color: var(--ink-2);
}

.dish__how {
  margin: 0;
  padding-left: 10px;
  border-left: 1px solid var(--line-2);
  font-size: 11.5px;
  line-height: 1.85;
  color: var(--ink-3);
}

.menu-foot {
  margin: 30px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-3);
}
.menu-foot .micro { margin-right: 6px; }

/* ─────────── 拖拽幽灵 ─────────── */

.drag-ghost {
  position: fixed;
  z-index: 9998;
  pointer-events: none;
  margin: 0;
  opacity: .92;
  transform: rotate(-2deg) scale(1.04);
  filter: drop-shadow(0 12px 22px rgba(43, 38, 34, .25));
}
.drag-ghost .picker__thumb,
.drag-ghost .avatar__art { outline-color: var(--accent); }

/* ─────────── 新模块响应式 ─────────── */

@media (max-width: 1080px) {
  .avatars { max-width: 430px; }
  .chamber { max-width: 360px; }
}

@media (max-width: 900px) {
  .gauges { grid-template-columns: 1.2fr 1fr 1fr; }
  .gauge--lead .gauge__v { font-size: 34px; }
  .dishes { gap: 26px 20px; }
}

@media (max-width: 720px) {
  .avatars { gap: 14px 4px; }
  .avatars .avatar { width: calc(20% - 4px); }
  .avatar__name { font-size: 10px; }
  .avatar__meta { display: none; }
  .chamber { aspect-ratio: 1; max-width: none; }
  .dishes { grid-template-columns: 1fr; gap: 26px; }
  .dish__img { aspect-ratio: 16 / 10; }
  .gauges { grid-template-columns: 1fr 1fr; row-gap: 16px; }
  .gauge--lead { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 12px; }
  .gauge--lead .gauge__v { font-size: 38px; }
  .gauge + .gauge { border-left: 0; padding-left: 0; }
  .gauge:nth-child(3) { border-left: 1px solid var(--line-2); padding-left: 14px; }
  .menu-head { flex-wrap: wrap; gap: 6px; }
}

@media (max-width: 420px) {
  .avatars { gap: 12px 3px; }
  .avatar__name { font-size: 9.5px; margin-top: 6px; }
}

/* ═══════════════════════════════════════════════════════════
   2.0 新增：小程序码位、关于、导航态（2026-10 评审反馈）
   ═══════════════════════════════════════════════════════════ */

/* ─────────── 小程序码（申请中占位） ─────────── */

.qr-card { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }

.qr-card__box {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px dashed var(--ink-5);
  background: var(--paper-3);
}

.qr-card__box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.qr-card__ph {
  font-size: 10.5px;
  line-height: 1.8;
  letter-spacing: .14em;
  color: var(--ink-4);
  text-align: center;
}

.qr-card__meta { display: flex; flex-direction: column; gap: 6px; }
.qr-card__title {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
}
.qr-card__note {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.8;
  color: var(--ink-4);
}

/* ─────────── 指标行下的诚实注脚 ─────────── */

.facts__note {
  max-width: var(--maxw);
  margin: 14px auto 0;
  padding: 0 var(--gut);
  font-size: 11.5px;
  line-height: 1.85;
  color: var(--ink-4);
  text-align: right;
}

/* ─────────── 01 关于 ─────────── */

.about { padding: clamp(64px, 8vw, 112px) 0 0; }

.about__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.about__head { max-width: 44em; }

.about__lede {
  margin: 20px 0 0;
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.95;
  color: var(--ink-2);
  text-wrap: pretty;
}

.about__ask {
  margin: 18px 0 0;
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--accent);
}

.about__cols {
  display: grid;
  grid-template-columns: 1.42fr 1fr;
  gap: clamp(36px, 5vw, 84px);
  margin-top: clamp(34px, 4.5vw, 60px);
  padding-top: clamp(26px, 3vw, 40px);
  border-top: 1px solid var(--line);
}

.about__col { min-width: 0; }

.timeline { list-style: none; margin: 16px 0 0; padding: 0; }

.timeline li {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  column-gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-2);
}
.timeline li:last-child { border-bottom: 0; padding-bottom: 0; }

.timeline__when {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .03em;
  color: var(--ink-4);
  padding-top: 2px;
  white-space: nowrap;
}
.timeline__what { font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.timeline__note {
  grid-column: 2;
  margin-top: 7px;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--ink-3);
  text-wrap: pretty;
}

.skills { list-style: none; margin: 14px 0 0; padding: 0; }
.skills + .micro { margin-top: 34px; display: block; }
.skills li {
  padding: 11px 0;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line-2);
}
.skills li:last-child { border-bottom: 0; }
.skills b {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink);
}

/* ─────────── 导航当前段 ─────────── */

.topbar__nav a.is-active { color: var(--accent); }
.topbar__nav a.is-active::after { right: 0; }

/* ─────────── 联系方式明细、食谱角色声音 ─────────── */

.link-arrow__meta {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .06em;
  color: var(--ink-4);
}

.voice--menu { margin-top: 22px; }

@media (max-width: 1080px) {
  .opening__figure {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    justify-self: center;
  }
  .about__cols { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 900px) {
  .opening__figure {
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    gap: 20px;
    margin-top: 34px;
  }
  .opening__phone { width: min(260px, 72%); justify-self: center; }
  .qr-card {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    border-top: 1px solid var(--line-2);
    padding-top: 18px;
  }
  .qr-card__box { width: 96px; flex: none; }
  .opening__figure figcaption { text-align: left; }
  .facts__note { text-align: left; }
  .timeline li { grid-template-columns: 1fr; }
  .timeline__note { grid-column: 1; }
  .timeline__when { padding-top: 0; }
}

/* ═══════════════════════════════════════════════════════════
   食谱卡：窄屏改「图左文右」（2026-10-31）
   原来 ≤720px 是单列、图 16:10 占满整行，400 宽下就有一块
   400×250 的大图，正文被压到下面看不见。改成横向后一张卡只占 130px 高，
   同一屏能看到两道菜。
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 720px) {
  .dishes {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 20px;
  }

  .dish {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    column-gap: 15px;
    align-items: start;
  }

  .dish__img {
    aspect-ratio: 1 / 1;
    border-radius: 2px;
  }

  .dish__score {
    right: 6px;
    top: 6px;
    min-width: 28px;
    padding: 2px 6px;
    font-size: 12px;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(43, 38, 34, .86);
  }

  .dish__body { padding-top: 0; }

  .dish__name {
    margin-bottom: 3px;
    font-size: 16px;
  }

  .dish__why {
    margin-bottom: 7px;
    font-size: 11.5px;
    line-height: 1.68;
  }

  .dish__macro {
    gap: 3px 11px;
    padding-top: 7px;
    font-size: 10.5px;
  }
  .dish__macro b { font-size: 11px; }

  .dish__rec { margin-top: 7px; padding-top: 6px; }
  .dish__rec summary { font-size: 10px; }
}

@media (max-width: 380px) {
  .dish { grid-template-columns: 108px minmax(0, 1fr); column-gap: 12px; }
  .dish__name { font-size: 15px; }
}

/* ═══════════════════════════════════════════════════════════
   识膳 / 建档：窄屏改「大图在上 + 结果在下」（2026-11-03）
   之前是「左小图 sticky + 右结果」并排，图缩成 127px 方块、
   结果挤在 196px 里，且 sticky 跟滚观感怪。竖屏改成上下结构：
   素材是 16:10 横图，全宽放正好不裁，结果区也拿到整行宽度。
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 720px) {
  .stage { padding: 46px 0; }

  .stage__main {
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
  }

  .frame { aspect-ratio: 16 / 10; position: relative; top: auto; }
  .chamber { aspect-ratio: 4 / 3; position: relative; top: auto; }
  .frame__hint { font-size: 14px; }
  .frame__sub { font-size: 10.5px; letter-spacing: .04em; }
  .frame__plus { width: 30px; height: 30px; }
  .frame__reset {
    top: 10px; right: 10px;
    font-size: 10.5px; letter-spacing: .05em;
    padding: 4px 11px;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(43, 38, 34, .86);
  }

  .readout { min-height: 0; padding-top: 0; }
  .readout__top { margin-bottom: 8px; }
  .readout__schema { font-size: 9.5px; letter-spacing: .04em; }

  .food { padding: 10px 0; gap: 4px 12px; }
  .food__name { font-size: 14px; }
  .food__kcal { font-size: 16.5px; }
  .food__meta { font-size: 11px; }
  .total { padding: 12px 0 14px; }
  .split { padding: 14px 0 2px; }
  .split__head { font-size: 10px; margin-bottom: 10px; }
  .split__row { font-size: 11px; }
  .split__meta { font-size: 11.5px; }
  .split__meta em { font-size: 13px; }
  .voice { font-size: 12px; line-height: 1.75; padding-left: 10px; }

  .ghost__row { font-size: 11.5px; padding: 7px 0; }
  .ghost__hint { font-size: 10.5px; }

  /* 体检仓：全宽 4:3，仓内文字跟着收 */
  .chamber__hint { font-size: 13px; line-height: 1.35; }
  .chamber__sub { font-size: 9.5px; letter-spacing: .06em; margin-top: 3px; }
  .chamber__figure { width: 46%; }
  .chamber__ring { inset: 10px; }

  /* 建档结果里的六格仪表，两列挤在 213px 里，压字号 */
  .gauges { gap: 0; }
  .gauge__l { font-size: 9.5px; letter-spacing: .04em; }
  .gauge__v { font-size: 20px; }
  .gauge--lead .gauge__v { font-size: 26px; }
  .btn-more { font-size: 11px; padding: 9px 12px; }
}

/* 窄屏折行收尾：合计行的「kcal」别掉到第二行 */
@media (max-width: 720px) {
  .total { gap: 8px; padding: 10px 0 12px; }
  .total span { font-size: 10px; letter-spacing: 0; }
  .total b { font-size: 21px; white-space: nowrap; }
  .total b small { font-size: 9px; margin-left: 2px; letter-spacing: .04em; }
  .gauge__v { letter-spacing: -.01em; }
}

/* ══════════════ 首屏三截图 3D 环绕台（2026-11-03 自 v3 同步） ══════════════
   卡片的 transform / opacity 由 foodiary.html 页尾的环形引擎逐帧写入，
   这里只管底盘。三张卡 = 首页 / 识别结果 / 营养小账本，同一餐的三段记录。 */

.shots3d { min-width: 0; }

.shots3d .stage3d {
  position: relative;
  height: clamp(300px, 24vw, 360px);
  perspective: 1100px;
  perspective-origin: 50% 44%;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y; /* 竖向滑动还给页面，横向拖动归环绕台 */
  user-select: none;
  -webkit-user-select: none;
}
.shots3d .stage3d.is-drag { cursor: grabbing; }

.shots3d .shot-card {
  --cw: clamp(118px, 11vw, 158px);
  position: absolute;
  top: 2px;
  left: 50%;
  width: var(--cw);
  margin: 0 0 0 calc(var(--cw) / -2);
  backface-visibility: hidden;
  will-change: transform, opacity;
  cursor: pointer;
}
.shots3d .stage3d.is-drag .shot-card { cursor: grabbing; }

.shots3d .shot-card img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-2);
  background: #fff;
  pointer-events: none; /* 拖拽判定统一落在卡片层，图片别抢事件 */
  -webkit-user-drag: none;
}

/* 当前那张的说明：三条叠放，只亮一条 */
.shots3d .shots__meta {
  position: relative;
  height: 20px;
  margin-top: 2px;
  text-align: center;
}
.shots3d .shots__cap {
  position: absolute;
  inset: 0;
  margin: 0;
  font-size: 11.5px;
  line-height: 20px;
  letter-spacing: .04em;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity .32s ease;
}
.shots3d .shots__cap.is-on { opacity: 1; }

.shots3d .shots__dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 10px;
}
.shots3d .shots__dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink-5);
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.shots3d .shots__dot:hover { background: var(--ink-4); }
.shots3d .shots__dot.is-on {
  background: var(--accent);
  transform: scale(1.4);
}

/* 环绕台下面，小程序码横排 */
.opening__figure .qr-card {
  flex-direction: row;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line-2);
  padding-top: 18px;
}
.opening__figure .qr-card__box { width: 96px; flex: none; }
