/* 菜谱 · Le Menu —— 刻意的深色餐厅品鉴菜单，单一主题（不跟随系统浅色） */
:root {
  --ink: #14120c;          /* 底 · 墨 */
  --ink-2: #1c1911;        /* 卡片底 */
  --ink-3: #211d13;        /* 略亮卡片 */
  --ivory: #efe6d4;        /* 主字 · 象牙 */
  --ivory-2: #cfc3a8;      /* 次要象牙 */
  --warm: #9a8f78;         /* 说明暖灰 */
  --warm-2: #7d735f;       /* 更弱 */
  --gold: #d9b98a;         /* 香槟金 · 强调 */
  --gold-line: #b08a52;    /* 金线 · 边框/当前封面 */
  --hair: #34301f;         /* 分隔细线 */
  --hair-2: #6d5f45;       /* 装饰短线 */
  --serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --latin: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--serif);
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.view { max-width: 680px; margin: 0 auto; padding: 28px 20px calc(40px + env(safe-area-inset-bottom)); }
.hidden { display: none !important; }

/* ---------- 列表页：全屏沉浸布局 ---------- */
#view-list {
  max-width: none; margin: 0; padding: 0;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden;
}
.menu-head { text-align: center; padding: calc(20px + env(safe-area-inset-top)) 0 4px; }
.menu-title { font-family: var(--serif); font-size: 25px; font-weight: 600; letter-spacing: .34em; color: var(--ivory); text-indent: .34em; }
.menu-sub { font-family: var(--latin); font-style: italic; font-size: 13px; color: var(--warm); margin-top: 8px; letter-spacing: .04em; }
.menu-line { width: 34px; height: 1px; background: var(--hair-2); margin: 13px auto 0; }

#search {
  display: block; width: 100%; max-width: 340px; margin: 20px auto 0;
  padding: 8px 4px; text-align: center;
  font-family: var(--serif); font-size: 15px; color: var(--ivory);
  background: transparent; border: none; border-bottom: 1px solid var(--hair);
  outline: none; transition: border-color .25s;
}
#search::placeholder { color: var(--warm-2); font-style: italic; }
#search:focus { border-color: var(--gold-line); }

.chips {
  display: flex; gap: 20px; justify-content: center; flex-wrap: nowrap;
  margin: 18px -20px 0; padding: 2px 20px 4px;
  overflow-x: auto; white-space: nowrap; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; font-size: 13px; color: var(--warm);
  letter-spacing: .06em; cursor: pointer; user-select: none;
  padding-bottom: 4px; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s;
}
.chip.on { color: var(--gold); border-color: var(--gold-line); }

/* ---------- Cover Flow ---------- */
#coverflow-wrap {
  flex: 1; min-height: 240px;
  margin: 18px 0 0; width: 100%;
  overflow: hidden; position: relative;
  perspective: 1300px;
  touch-action: pan-y; user-select: none;
  background:
    radial-gradient(ellipse 44% 46% at 50% 46%, rgba(216,185,138,.11), transparent 72%);
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}
#coverflow { position: absolute; inset: 0; transform-style: preserve-3d; }

.cover {
  position: absolute;
  width: 210px; height: 210px;
  left: 50%; top: 50%; margin-left: -105px; margin-top: -118px;
  transition: transform .4s ease, opacity .4s ease, box-shadow .4s ease;
  transform-style: preserve-3d;
  cursor: pointer;
  background: var(--ink-2);
  border: 1px solid var(--hair);
  overflow: hidden;
  -webkit-box-reflect: below 4px linear-gradient(transparent, transparent 64%, rgba(216,185,138,.10));
}
#coverflow.dragging .cover { transition: none; }
.cover.is-center { border-color: var(--gold-line); box-shadow: 0 0 0 1px var(--gold-line), 0 14px 34px rgba(0,0,0,.55); }

.cover .text-cover {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 18px; text-align: center;
  font-family: var(--serif); font-weight: 600; color: var(--ivory);
  line-height: 1.4; letter-spacing: .06em;
  background: linear-gradient(158deg, rgba(216,185,138,.09), transparent 52%);
  pointer-events: none;
}
.cover.has-img { background-size: cover; background-position: center; }
.cover.has-img .cover-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 24px 14px 12px; text-align: center;
  font-family: var(--serif); font-size: 19px; font-weight: 600; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.78));
  pointer-events: none;
}

#cf-info { text-align: center; margin-top: 18px; min-height: 52px; }
#cf-info h2 { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--ivory); letter-spacing: .04em; }
#cf-info p { font-family: var(--latin); font-style: italic; font-size: 13px; color: var(--warm); margin-top: 4px; font-variant-numeric: tabular-nums; }
.footer-note { margin-top: 14px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--warm-2); text-align: center; letter-spacing: .02em; }

/* ---------- 详情页 ---------- */
.detail-header { text-align: center; position: relative; padding-top: 4px; }
.detail-header h2 { font-family: var(--serif); font-size: 27px; font-weight: 600; color: var(--ivory); letter-spacing: .06em; }
.detail-rule { width: 34px; height: 1px; background: var(--hair-2); margin: 12px auto 0; }
.icon-btn {
  position: absolute; left: 0; top: 0;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--hair); background: transparent; color: var(--gold);
  font-size: 17px; cursor: pointer; transition: border-color .2s;
}
.icon-btn:hover { border-color: var(--gold-line); }
.detail-meta {
  text-align: center; font-family: var(--latin); font-style: italic;
  color: var(--warm); font-size: 13.5px; margin-top: 14px; font-variant-numeric: tabular-nums;
}

section { margin-top: 34px; }
section h3 {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 13px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
  padding-bottom: 9px; border-bottom: 1px solid var(--hair); margin-bottom: 14px;
}
section h3 em { font-family: var(--latin); font-style: italic; text-transform: none; letter-spacing: .02em; font-size: 12px; color: var(--warm-2); font-weight: 400; }

.ingredients li {
  list-style: none; padding: 8px 2px; border-bottom: 1px dashed var(--hair);
  font-size: 15.5px; color: var(--ivory); cursor: pointer; transition: color .2s;
}
.ingredients li.done { color: var(--warm-2); text-decoration: line-through; }

.steps { list-style: none; counter-reset: step; }
.steps li { position: relative; padding-left: 34px; margin-bottom: 18px; font-size: 15.5px; color: var(--ivory); counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  font-family: var(--latin); font-style: italic; font-size: 15px; color: var(--gold);
  width: 22px; text-align: center;
}
.steps blockquote, #cook-step-why {
  margin-top: 8px; padding: 9px 14px; font-size: 13.5px; color: var(--warm);
  background: var(--ink-3); border-left: 2px solid var(--gold-line); border-radius: 0 4px 4px 0;
  line-height: 1.7;
}
.tips li { list-style: none; padding: 5px 0 5px 18px; position: relative; font-size: 14.5px; color: var(--warm); }
.tips li::before { content: "—"; position: absolute; left: 0; color: var(--gold-line); }

.cook-bar { position: sticky; bottom: 14px; margin-top: 30px; }
.primary-btn {
  width: 100%; padding: 15px; font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: .16em;
  background: var(--gold); color: var(--ink); border: none; border-radius: 4px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.45); transition: background .2s;
}
.primary-btn:hover { background: var(--gold-line); }

/* ---------- 做菜模式 ---------- */
.cook {
  position: fixed; inset: 0; max-width: none; margin: 0; z-index: 10;
  background: var(--ink); display: flex; flex-direction: column; padding: 0;
}
.cook-header {
  display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
  border-bottom: 1px solid var(--hair);
}
.cook-header .icon-btn { position: static; }
.cook-title { flex: 1; display: flex; flex-direction: column; }
#cook-name { font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--ivory); letter-spacing: .06em; }
#cook-progress { font-family: var(--latin); font-style: italic; font-size: 12.5px; color: var(--warm); font-variant-numeric: tabular-nums; }

#cook-main { flex: 1; overflow-y: auto; padding: 34px 26px; max-width: 640px; width: 100%; margin: 0 auto; }
#cook-step-label { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 14px; }
#cook-step-text { font-family: var(--serif); font-size: 25px; line-height: 1.75; font-weight: 500; color: var(--ivory); }
#cook-step-why { margin-top: 22px; font-size: 15px; }

.cook-controls {
  display: flex; gap: 12px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hair); background: var(--ink-2);
}
.nav-btn {
  flex: 1; padding: 16px; font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: .08em;
  border: 1px solid var(--gold-line); border-radius: 4px;
  background: transparent; color: var(--ivory); cursor: pointer; transition: opacity .2s;
}
.nav-btn:disabled { opacity: .3; }
#btn-next { background: var(--gold); color: var(--ink); border-color: var(--gold); }

/* ---------- 全局手势 ---------- */
.float-cam {
  position: fixed; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom));
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--gold-line); background: var(--ink-2); color: var(--gold);
  font-size: 19px; cursor: pointer; z-index: 30;
  box-shadow: 0 6px 18px rgba(0,0,0,.5);
}
.float-cam.on { background: var(--gold); border-color: var(--gold); }
#gesture-panel {
  position: fixed; right: 16px; bottom: calc(78px + env(safe-area-inset-bottom));
  width: 132px; border-radius: 6px; overflow: hidden;
  background: #000; box-shadow: 0 6px 20px rgba(0,0,0,.6); z-index: 30;
  border: 1px solid var(--hair);
}
#gesture-video { width: 100%; display: block; transform: scaleX(-1); }
#gesture-status {
  font-family: var(--latin); font-size: 11px; color: var(--gold);
  background: rgba(0,0,0,.82); padding: 5px 6px; text-align: center; line-height: 1.5;
}

/* ---------- 动效 ---------- */
.flash { animation: flash .45s ease; }
@keyframes flash { 0% { background: rgba(216,185,138,.07); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
