﻿:root {
  --bg: #fff;
  --ink: #000;
  --muted: #666;
  --rule: #ddd;
  --planet: #d6d6d6;
  --soft: #f7f7f7;
  --bulb: #ffd84a;
  --card: #fff;
  --text: #000;
  --line: #ddd;
  --accent: #333;
  --ease: cubic-bezier(.2,.9,.2,1);
  /* 安全区域变量（iPhone X+ 刘海屏适配） */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* 左上角全屏按钮 - 参考"重新开始"手绘风格 */
.fullscreen-btn {
  position: fixed;
  top: 24px;
  left: 34px;
  z-index: 900;
  color: var(--muted);
  padding: 10px 22px 11px;
  border: 2px solid currentColor;
  border-radius: 58% 42% 54% 46% / 47% 58% 42% 53%;
  background: rgba(255,255,255,.86);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  opacity: 1;
  transition: color .3s ease, background .3s ease, transform .3s ease;
}

.fullscreen-btn:hover {
  color: var(--ink);
  background: var(--bg);
  transform: rotate(-2deg) translateY(-2px);
}

.fullscreen-btn.active {
  color: var(--ink);
  background: var(--soft);
}

.fullscreen-btn .fs-label {
  display: inline-block;
}

.fullscreen-btn .fs-label::before {
  content: "";
}

.fullscreen-btn.active .fs-label::before {
  content: "";
}

* { box-sizing: border-box; }

/* ===== 全局居中底座 ===== */
/* body 使用 flex 占满整个可视区，水平+垂直居中所有主内容 */
html {
  width: 100%;
  height: 100%;
}

body {
  width: 100%;
  height: 100vh;          /* 页面高度固定为可视区高度，防止被内容撑开导致居中基准变化 */
  min-height: 100vh;
  /* 移动端使用 dvh 避免地址栏跳动，降级使用 100vh */
  min-height: 100dvh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;       /* 禁止滚动条，避免滚动条占用空间导致视觉偏移 */
  display: flex;          /* flex 主容器 */
  justify-content: center;/* 水平居中所有主内容 */
  align-items: center;    /* 垂直居中所有主内容 */
  background-color: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", "WenQuanYi Micro Hei", sans-serif;
  /* 安全区域适配 */
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
}

/* viewport 占满 body，grid 双居中：子项在轨道内居中，轨道本身也在容器内居中 */
.viewport {
  position: relative;     /* 作为 body 的 flex 子项，参与 flex 居中 */
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;    /* grid 子项在其单元格内居中 */
  place-content: center;  /* grid 轨道在容器内居中 */
  justify-content: center;
  align-content: center;
  overflow: hidden;       /* 裁剪 1920×1080 大画布的布局溢出，只显示缩放后的可视区域 */
  background: transparent;
}

/* 1920×1080 固定设计稿，transform-origin center 保证 scale 从中心缩放，不偏移 */
.app {
  position: relative;
  width: 1920px;
  height: 1080px;
  margin: auto;            /* grid/flex 中自动居中 */
  justify-self: center;    /* grid 中水平居中，即使内容溢出 */
  align-self: center;      /* grid 中垂直居中 */
  overflow: hidden;
  background: transparent;
  transform-origin: center center; /* 缩放原点设在画布中心，缩放后仍居中 */
  /* 移动端兼容：移除 contain 避免渲染异常 */
  will-change: transform;
}

.start-hit {
  position: absolute;
  inset: 0;
  z-index: 20;
  cursor: pointer;
}

/* ===== 标题区：flex 居中 ===== */
.hero {
  position: absolute;
  left: 0;
  top: 40%;               /* 上移至视觉中心，补偿副标题高度使标题组整体居中、无偏下感 */
  z-index: 10;            /* 确保标题在所有动效元素上方 */
  width: 100%;
  text-align: center;     /* 文字本身居中对齐 */
  transform: translate3d(0, -50%, 0); /* 自身高度回拉，完美垂直居中 */
  pointer-events: none;
  transition: opacity .8s ease;
  will-change: opacity, transform;
  padding-left: 74px;    /* 大小标题往右移一个字的宽度 */
}

/* 主标题 flex 水平居中 */
.hero-title {
  display: flex;
  justify-content: center; /* flex 居中每个字 span */
  width: 100%;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Arial Rounded MT Bold", sans-serif;
  font-size: 74px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 1px;
}

.hero-title span {
  display: inline-block;
  transition: opacity .8s ease, transform 1s var(--ease), filter .8s ease;
  will-change: opacity, transform, filter;
}

/* 副标题居中 */
.hero-subtitle {
  width: 100%;
  margin-top: 32px;
  text-align: center;     /* 文字居中 */
  color: var(--muted);
  font-size: 24px;
  font-weight: 400;
  transition: opacity .8s ease, transform .8s var(--ease);
  will-change: opacity, transform;
}

/* 开场提示语 */
.start-prompt {
  width: 100%;
  margin-top: 0;
  text-align: center;
  color: var(--ink);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 2px;
  padding-left: 32px;    /* 往右移一个字的宽度 */
}

/* 首页操作指引"点击屏幕开始"：靠下中间，放大缩小循环动画 */
.tap-guide {
  position: absolute;
  left: 50%;
  top: 78%;               /* 靠下中间位置 */
  z-index: 12;
  color: var(--ink);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 6px;
  white-space: nowrap;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  margin-left: 34px;     /* 往右移一个字的宽度 */
  transform: translate3d(-50%, -50%, 0);
  animation: tapPulse 1.6s ease-in-out infinite;
  transition: opacity .5s ease, visibility .5s ease;
  will-change: transform, opacity;
}

@keyframes tapPulse {
  0%, 100% { transform: translate3d(-50%, -50%, 0) scale(1); opacity: .55; }
  50%      { transform: translate3d(-50%, -50%, 0) scale(1.18); opacity: 1; }
}

/* 离开首页后隐藏指引 */
.phase-gate .tap-guide,
.phase-zoom .tap-guide,
.phase-select .tap-guide,
.phase-result .tap-guide,
.phase-skip .tap-guide {
  opacity: 0;
  visibility: hidden;
}

/* 开场圆圈按钮 */
.start-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 40px;
  max-width: 1100px;
}

.start-btn {
  width: 160px;
  height: 160px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: rgba(255,255,255,.86);
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: transform .3s var(--ease), background .3s ease, color .3s ease;
}

.start-btn:hover {
  transform: translateY(-6px);
  background: var(--ink);
  color: var(--bg);
}

/* 更多玩法折叠区 */
.more-plays-wrap {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.more-plays-btn {
  display: none;
}
.more-plays-btn:hover {
  border-color: var(--ink);
  background: rgba(0,0,0,.04);
}
.more-plays-btn.open {
  border-color: var(--ink);
}
.more-plays-btn.open::after { content: " ▲"; }
.more-plays-btn:not(.open)::after { content: " ▼"; }
.more-plays-btn::after { content: " ▼"; }

.more-plays-menu {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 16px auto 0;
  max-width: 600px;
  animation: fadeInUp .3s ease;
}
.more-plays-menu.open { display: flex; }
.more-plays-item {
  padding: 10px 22px;
  border: 2px solid var(--ink);
  border-radius: 30px;
  background: rgba(255,255,255,.86);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .25s var(--ease), background .25s ease, color .25s ease;
}
.more-plays-item:hover {
  transform: translateY(-4px);
  background: var(--ink);
  color: var(--bg);
}

/* 套餐子选项菜单 */
.combo-submenu {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  width: 100%;
  box-sizing: border-box;
  animation: fadeInUp .3s ease;
}
.combo-submenu.open {
  display: flex;
}
/* 在 more-plays-menu 的 grid 布局里横跨整行并居中 */
.more-plays-menu.open .combo-submenu {
  grid-column: 1 / -1;
  justify-self: center;
  width: 100%;
  align-items: center;
  text-align: center;
}

.combo-roller-wrap {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  padding: 0 4px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
}
.combo-roller-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.combo-roller-label {
  font-size: 12px;
  color: #999;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.combo-roller-label .roller-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  min-width: 18px;
  text-align: center;
}
.combo-roller {
  width: 56px;
  height: 120px;
  min-height: 120px;
  overflow: hidden;
  position: relative;
  border-radius: 12px;
  background:
    linear-gradient(to bottom, rgba(255,255,255,.9) 0, rgba(255,255,255,0) 40px, rgba(255,255,255,0) 80px, rgba(255,255,255,.9) 120px),
    rgba(255,255,255,.6);
  border: 1px solid rgba(0,0,0,.08);
  touch-action: none;
  flex-shrink: 0;
}
.combo-roller .roller-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform;
}
.combo-roller .roller-list .roller-item {
  height: 40px;
  min-height: 40px;
  line-height: 40px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  transition: opacity .2s, transform .2s;
  flex-shrink: 0;
}
/* 中心选中框：两条线在数字上下 */
.combo-roller::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 40px;
  height: 40px;
  border-top: 2.5px solid var(--ink);
  border-bottom: 2.5px solid var(--ink);
  pointer-events: none;
  z-index: 3;
}

.combo-confirm-btn {
  padding: 8px 28px;
  border: 2px solid var(--ink);
  border-radius: 30px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .25s var(--ease), background .25s ease;
}
.combo-confirm-btn:hover {
  transform: translateY(-3px);
}
.combo-confirm-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none;
}

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

/* 套餐页面 */
.combo-page {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 800;
  background: var(--bg);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.2) transparent;
}
.combo-page::-webkit-scrollbar {
  width: 6px;
}
.combo-page::-webkit-scrollbar-track {
  background: transparent;
}
.combo-page::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.15);
  border-radius: 3px;
}
.combo-page::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,.3);
}
.combo-page.active { display: block; }
.combo-page-scroll {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 20px 40px;
  min-height: 100vh;
}
.combo-cards-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: flex-start;
}
/* 套餐中复用 result-card */
.combo-cards-row .result-card {
  margin: 12px 0 0;
  width: 220px;
  min-width: 200px;
  max-width: 260px;
}
.combo-detail-area {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 60px;
}
.combo-detail-card {
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.combo-detail-card .dish-name {
  text-align: center;
}
.combo-detail-card .story {
  text-align: center;
}
.combo-detail-card .module {
  opacity: 1;
  transform: none;
  text-align: left;
  width: 100%;
  max-width: 480px;
}
.combo-detail-card .flip-tip {
  text-align: center;
}
.combo-detail-empty {
  text-align: center;
  color: #999;
  font-size: 13px;
  padding: 30px 0;
}

/* 旧套餐卡片样式（废弃，保留兼容） */
.combo-cards {
  display: none;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 20px;
}
.combo-cards.show { display: flex; }
.combo-card {
  width: 140px;
  background: #fff;
  border-radius: 12px;
  padding: 10px 10px 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  text-align: center;
  opacity: 0;
  transform: rotateY(90deg);
  transition: transform .5s ease, opacity .5s ease;
}
.combo-card.flipped {
  opacity: 1;
  transform: rotateY(0);
}
.combo-card-art {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 6px;
  overflow: hidden;
}
.combo-card-art svg { width: 100%; height: 100%; }
.combo-card-label {
  font-size: 11px;
  color: #999;
  margin-top: 6px;
}
.combo-card-name {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  margin-top: 2px;
}

/* gate 页面按钮下方解释文字 */
.gate-explain {
  margin-top: 56px;
  text-align: center;
  color: var(--muted);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 2px;
  line-height: 1.6;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 14px, 0);
  transition: opacity .3s ease, transform .3s var(--ease), visibility .3s ease;
  pointer-events: none;
}

.gate-explain.show {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
}

/* 第二画面：gate-page，初始隐藏，phase-gate 时显示 */
.gate-page {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .6s ease;
}

.gate-title {
  margin: 0 0 48px;
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 4px;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease .15s, transform .6s var(--ease) .15s;
}
.phase-gate .gate-title {
  opacity: 1;
  transform: translateY(0);
}

.phase-gate .gate-page {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.phase-gate .hero {
  opacity: 0;
  visibility: hidden;
}

/* ===== 火柴小人+半透明星球+装饰符号组合模块 ===== */
/* 初始状态：整个组合位于 app 画布左下角区域；统一用 top 做动画，保证 left/top 可同时过渡 */
.planet-system {
  position: absolute;
  left: 120px;            /* 屏幕左下角区域，靠近左侧 */
  top: 668px;             /* 1080 - 126(底部留白) - 286(模块高) = 668，稳在画面下方 */
  bottom: auto;
  z-index: 2;             /* 动效元素在文字标题下方 */
  width: 250px;
  height: 286px;
  transform: translate3d(0, 0, 0);
  transition: transform 1.2s linear;
  will-change: transform;
  backface-visibility: hidden;
}

.rotor {
  position: absolute;
  left: 10px;
  bottom: 0;
  width: 230px;
  height: 274px;
  transform-origin: 115px 189px;
  animation: syncSpin 8s linear infinite;
  will-change: transform;
  transform: translate3d(0,0,0);
  backface-visibility: hidden;
}

.phase-zoom .planet {
  animation: planetBounce .8s linear infinite;
}

.planet {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  width: 230px;
  height: 230px;
  border: 2px solid var(--planet);
  border-radius: 50%;
  background: var(--bg);
  overflow: hidden;
  transform: translateZ(0);
}

.planet::before,
.planet::after {
  content: "";
  position: absolute;
  left: 25px;
  width: 180px;
  height: 48px;
  border: 2px solid var(--planet);
  border-left-color: transparent;
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(0deg);
}

.planet::before { top: 54px; }
.planet::after { top: 122px; left: 44px; width: 142px; opacity: .68; }

.thinker {
  position: absolute;
  left: 50%;              /* 在 planet 正上方水平居中 */
  bottom: 242px;          /* 230(球高) + 12(间距) = 242，小人底部在小球顶部上方 12px */
  width: 40px;
  height: 52px;
  color: var(--ink);
  z-index: 3;
  transform: translate3d(-50%, 0, 0); /* 自身宽度回拉，使小人居中站立 */
  animation: walkInPlace .8s linear infinite;
  will-change: transform;
  backface-visibility: hidden;
}

.head {
  position: absolute;
  left: 8px;
  top: 0;
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 50%;
  animation: headWalk .8s linear infinite;
  transform-origin: center bottom;
  will-change: transform;
}

.eye {
  position: absolute;
  top: 9px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  animation: slowBlink 3s steps(180, end) infinite;
  will-change: transform;
}

.eye.left { left: 6px; }
.eye.right { right: 6px; }

.body {
  position: absolute;
  left: 19px;
  top: 25px;
  width: 2px;
  height: 22px;
  border-radius: 3px;
  background: currentColor;
}

.arm {
  position: absolute;
  top: 32px;
  width: 14px;
  height: 2px;
  border-radius: 4px;
  background: currentColor;
  transform-origin: center;
  will-change: transform, opacity;
}

.arm.right {
  left: 20px;
  transform-origin: left center;
  animation: rightWalkArm .8s linear infinite;
}

.arm.left {
  left: 6px;
  transform-origin: right center;
  animation: leftWalkArm .8s linear infinite;
}

.leg {
  position: absolute;
  top: 45px;
  width: 13px;
  height: 2px;
  border-radius: 3px;
  background: currentColor;
  transform-origin: center;
  will-change: transform;
}

.leg.left {
  left: 8px;
  transform-origin: right center;
  animation: leftWalkLeg .8s linear infinite;
}
.leg.right {
  left: 19px;
  transform-origin: left center;
  animation: rightWalkLeg .8s linear infinite;
}

.shadow-dot {
  position: absolute;
  left: 56px;
  top: 49px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--planet);
  opacity: .75;
}

/* 小型装饰符号容器：初始完全隐藏，位于页面右侧垂直中轴、距离中心区 1/3 屏宽处 */
.symbols {
  position: absolute;
  left: 1600px;           /* 960(中心) + 640(1/3 屏宽) = 1600，右侧起始位 */
  top: 540px;             /* 页面垂直中轴 */
  z-index: 3;             /* 符号容器也在标题下方 */
  width: 78px;
  height: 60px;
  transform: translate3d(-50%, -50%, 0); /* 自身中心与起始位对齐 */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .4s ease, visibility .4s ease, left 1.2s linear, top 1.2s linear, transform 1.2s linear;
  will-change: left, top, transform, opacity;
}

.bulb {
  position: absolute;
  left: 50%;              /* 在 symbols 容器内水平居中 */
  top: 0;
  width: 22px;
  height: 30px;
  opacity: 0;
  transform: translate3d(-50%, 0, 0) scale(.3); /* 居中 + 初始缩小 */
  transition: margin-left 0.6s ease; /* 仅 margin-left 需要过渡；opacity/transform 由 keyframes 控制，避免与动画冲突 */
  will-change: opacity, transform;
  z-index: 4;
}

.bulb::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bulb);
  box-shadow: 0 0 18px rgba(255,216,74,.65);
}

.bulb::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 16px;
  width: 8px;
  height: 7px;
  border-radius: 2px;
  background: var(--ink);
}

.bulb.show { animation: bulbOut 1.2s var(--ease) forwards; }

.sprout {
  position: absolute;
  left: 50%;              /* 在 symbols 容器内水平居中 */
  top: 0;
  width: 26px;
  height: 28px;
  opacity: 0;
  transform: translate3d(-50%, 8px, 0) scale(.2); /* 居中 + 初始下移缩小 */
  transition: margin-left 0.6s ease; /* 仅 margin-left 需要过渡 */
  pointer-events: none;
  z-index: 4;
  will-change: opacity, transform;
}

.sprout::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 10px;
  width: 2px;
  height: 18px;
  border-radius: 2px;
  background: #2f7d32;
}

.sprout::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 4px;
  width: 20px;
  height: 13px;
  border-radius: 50% 50% 50% 0;
  border: 2px solid #2f7d32;
  border-right-color: transparent;
  border-bottom-color: transparent;
  transform: rotate(-22deg);
  box-shadow: 10px 0 0 -1px var(--bg), 10px 0 0 1px #2f7d32;
}

.companion {
  position: absolute;
  left: 57%;              /* 与 thinker 的 43% 对称 */
  bottom: 242px;          /* 与 thinker 相同高度 */
  width: 40px;
  height: 52px;
  color: var(--ink);
  z-index: 3;
  opacity: 0;
  transform: translate3d(-50%, 0, 0); /* 与 thinker 相同的居中方式 */
  pointer-events: none;
  will-change: opacity, transform;
}

.buddy-head {
  position: absolute;
  left: 8px;
  top: 0;
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: var(--bg);
  animation: headWalk .8s linear infinite;
  transform-origin: center bottom;
}

.buddy-eye {
  position: absolute;
  top: 9px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.buddy-eye.left { left: 6px; }
.buddy-eye.right { right: 6px; }

.buddy-body {
  position: absolute;
  left: 19px;
  top: 25px;
  width: 2px;
  height: 22px;
  border-radius: 3px;
  background: currentColor;
}

.buddy-arm,
.buddy-leg {
  position: absolute;
  height: 2px;
  border-radius: 4px;
  background: currentColor;
  will-change: transform;
}

.buddy-arm { top: 32px; width: 14px; }
.buddy-arm.right { left: 20px; transform-origin: left center; animation: rightWalkArm .8s linear infinite; }
.buddy-arm.left { left: 6px; transform-origin: right center; animation: leftWalkArm .8s linear infinite; }
.buddy-leg { top: 45px; width: 13px; }
.buddy-leg.left { left: 8px; transform-origin: right center; animation: leftWalkLeg .8s linear infinite; }
.buddy-leg.right { left: 19px; transform-origin: left center; animation: rightWalkLeg .8s linear infinite; }

.planet-system.companion-in .companion,
.planet-system.love-on .companion {
  opacity: 1;
  animation: companionArrive .8s var(--ease) forwards, walkInPlace .8s linear .8s infinite;
}

.planet-system.companion-in .thinker,
.planet-system.love-on .thinker {
  left: 43%;
}

.hearts {
  position: absolute;
  left: 50%;              /* 在 symbols 容器内水平居中 */
  top: 0;
  width: 78px;
  height: 34px;
  opacity: 0;
  transform: translate3d(-50%, 0, 0); /* 自身宽度回拉居中 */
  transition: margin-left 0.6s ease; /* 仅 margin-left 需要过渡 */
  pointer-events: none;
}

.hearts::before,
.hearts::after {
  content: "\2661";
  position: absolute;
  color: #f0a7ba;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 10px rgba(240,167,186,.22);
}

.hearts::before { left: 13px; top: 8px; }
.hearts::after { right: 11px; top: 2px; font-size: 26px; }

.symbols.love-on .hearts { animation: heartsFloat 1.6s ease-in-out infinite; }
.planet-system.paused,
.planet-system.paused * {
  animation-play-state: paused !important;
}
.symbols.sprout-on .sprout { animation: sproutGrow 1.15s var(--ease) forwards; }

@keyframes syncSpin { to { transform: rotate(360deg) translateZ(0); } }
/* 竖屏下滚轮缓慢滚动，避免快速旋转显得歪斜 */
@keyframes rollSlowly { to { transform: rotate(360deg) translateZ(0); } }
/* 小球滚动质感：仅1px垂直位移，linear曲线避免弹跳感，与小人walkInPlace完全同步 */
@keyframes planetBounce {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -1px, 0); }
}
/* 小人步行：仅1px垂直位移，与planetBounce相同频率和相位，保持12px固定距离 */
@keyframes walkInPlace {
  0%, 100% { transform: translate3d(-50%,0,0); }
  50% { transform: translate3d(-50%,-1px,0); }
}
@keyframes headWalk {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}
@keyframes rightWalkArm {
  0%, 100% { opacity: 1; transform: rotate(24deg); }
  50% { opacity: 1; transform: rotate(-18deg); }
}
@keyframes leftWalkArm {
  0%, 100% { opacity: 1; transform: rotate(-18deg); }
  50% { opacity: 1; transform: rotate(24deg); }
}
@keyframes leftWalkLeg {
  0%, 100% { transform: rotate(-34deg); }
  50% { transform: rotate(18deg); }
}
@keyframes rightWalkLeg {
  0%, 100% { transform: rotate(18deg); }
  50% { transform: rotate(-34deg); }
}
@keyframes slowBlink {
  0%, 70%, 82%, 100% { transform: scaleY(1); }
  76% { transform: scaleY(.05); }
}
@keyframes bulbOut {
  0% { opacity: 0; transform: translate3d(-50%,0,0) scale(.3); }
  14% { opacity: 1; transform: translate3d(-50%,0,0) scale(1); }
  30% { opacity: .55; transform: translate3d(-50%,0,0) scale(.96); }
  48% { opacity: 1; transform: translate3d(-50%,0,0) scale(1.04); }
  68% { opacity: .72; transform: translate3d(-50%,0,0) scale(1); }
  82% { opacity: 1; transform: translate3d(-50%,0,0) scale(1); }
  100% { opacity: 0; transform: translate3d(-50%,-8px,0) scale(.66); }
}
@keyframes sproutGrow {
  0% { opacity: 0; transform: translate3d(-50%,8px,0) scale(.2); }
  22% { opacity: 1; transform: translate3d(-50%,0,0) scale(1); }
  78% { opacity: 1; transform: translate3d(-50%,-2px,0) scale(1.04); }
  100% { opacity: 0; transform: translate3d(-50%,-10px,0) scale(.72); }
}
@keyframes companionArrive {
  0% { opacity: 0; transform: translate3d(calc(-50% + 74px), 0, 0); }
  100% { opacity: 1; transform: translate3d(-50%, 0, 0); }
}
@keyframes heartsFloat {
  0%, 100% { opacity: .22; transform: translate3d(-50%,6px,0) scale(.92); }
  35% { opacity: 1; transform: translate3d(-50%,-2px,0) scale(1); }
  70% { opacity: .58; transform: translate3d(-50%,-8px,0) scale(.96); }
}

.phase-zoom .hero-title span:not(.word-me) {
  opacity: 0;
  filter: blur(12px);
  transform: translate3d(0,-24px,0) scale(.9);
}

.phase-zoom .hero-subtitle {
  opacity: 0;
  transform: translate3d(0,22px,0);
}

/* phase-zoom：隐藏开场标题 */
.phase-zoom .hero {
  opacity: 0;
  visibility: hidden;
}

@keyframes wordMeToQuestion {
  0% { opacity: 1; transform: translate3d(0,0,0) scale(1); }
  100% { opacity: 1; transform: translate3d(0,0,0) scale(1); }
}

/* phase-zoom：小球+小人水平滚动到画面下方居中位置，不经过画布中心 */
.phase-zoom .planet-system {
  transform: translate3d(715px, 108px, 0); /* 直接到达底部居中，与 phase-select 相同 */
}

/* phase-select/result：小球+小人保持在画面底部居中 */
.phase-select .planet-system,
.phase-result .planet-system {
  transform: translate3d(715px, 108px, 0); /* 水平居中，底部定位 */
}

.phase-result .planet-system {
  opacity: 0;
  transform: translate3d(715px, -102px, 0) scale(.72);
  transition: opacity .55s ease, transform .7s var(--ease);
  pointer-events: none;
}

/* phase-zoom：装饰符号从右侧水平左移到页面中心，与小球小人组合对齐 */
.phase-zoom .symbols {
  left: 50%;
  top: 50%;
  opacity: 1;
  visibility: visible;
  transform: translate3d(-50%, -50%, 0);
}

/* phase-select：装饰符号容器归位到小人头顶上方；子元素保持基础隐藏态，仅由 JS 触发对应反馈动画 */
.phase-select .symbols {
  left: 50%;
  top: 730px;             /* 小人头顶附近：thinker top 约 770px，符号容器在其上方 */
  opacity: 1;
  visibility: visible;
  transform: translate3d(-50%, 0, 0);
}

/* phase-result：隐藏装饰符号容器，避免爱心等元素穿模到结果页 */
.phase-result .symbols {
  opacity: 0;
  visibility: hidden;
}

.phase-select .symbols .bulb,
.phase-select .symbols .sprout,
.phase-select .symbols .hearts,
.phase-result .symbols .bulb,
.phase-result .symbols .sprout,
.phase-result .symbols .hearts {
  margin-left: 0;         /* 取消任何展开偏移，恢复居中 */
}

/* 卡片翻转后隐藏正面爱心，防止边缘穿模 */
.result-card.flipped .final-card-hearts {
  opacity: 0 !important;
  animation: none !important;
}

.phase-select .hero,
.phase-result .hero {
  opacity: 0;
  visibility: hidden;
  transition: none;
}

.phase-select .hero-title span,
.phase-result .hero-title span {
  opacity: 0 !important;
  transition: none;
}

/* ===== 选择页 & 结果页：绝对定位覆盖整个app，通过opacity控制显隐 ===== */
.select-page,
.result-page {
  position: absolute;
  inset: 0;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0,18px,0);
  transition: opacity .7s ease, transform .7s var(--ease);
  will-change: opacity, transform;
}

.phase-select .select-page,
.phase-result .result-page {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0,0,0);
}

/* 问题标题：width:100% + text-align:center 居中文字 */
.question {
  position: absolute;
  left: 0;
  top: 118px;
  width: 100%;
  margin: 0;
  padding-left: 30px;     /* 整体视觉往右微调 */
  text-align: center;     /* 文字居中 */
  font-family: SimHei, "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 56px;
  font-weight: 900;
  letter-spacing: 2px;
  opacity: 1;
  transition: opacity .3s ease;
  will-change: opacity;
}

.question.fading {
  opacity: 0;
}

/* 卡片轨道容器：left:50% + translateX(-50%) 水平居中 */
.track-wrap {
  position: absolute;
  left: 50%;              /* 水平居中：父容器一半 */
  top: 285px;
  width: 1228px;
  max-width: calc(100% - 36%);
  overflow-x: auto;
  overflow-y: visible;
  padding: 18px 0 42px;
  transform: translate3d(-50%,0,0); /* 自身宽度回拉，完美居中 */
  transition: opacity .6s ease, transform .6s var(--ease);
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  will-change: opacity, transform;
}

.track-wrap::-webkit-scrollbar {
  display: none;
}

/* 卡片 flex 横排，justify-content:center + margin:0 auto 居中 */
.track {
  display: flex;
  gap: 22px;
  width: max-content;
  margin: 0 auto;         /* 自动外边距居中 */
  padding: 0 12px;
  justify-content: center; /* flex 主轴居中 */
  perspective: 1200px;     /* 3D 翻转透视 */
}

/* 狗狗滑块：left:50% + translateX(-50%) 水平居中 */
.dog-slider {
  position: absolute;
  left: 50%;              /* 水平居中 */
  top: 572px;
  width: 1228px;
  max-width: calc(100% - 36%);
  height: 52px;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .45s ease;
}

.dog-slider.visible {
  opacity: 1;
  pointer-events: auto;
}

.dog-slider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 16px;
  height: 1px;
  background: var(--rule);
}

.dog-handle {
  position: absolute;
  left: 0;
  top: 0;
  width: 90px;
  text-align: center;
  transform: translateX(-45px);
  transition: left .12s linear;
  will-change: left;
  cursor: grab;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
}

.dog-handle.dragging {
  cursor: grabbing;
  transition: none;
}

.dog-icon {
  display: block;
  width: 74px;
  height: 34px;
  margin: 0 auto;
  fill: #fff;
  stroke: var(--ink);
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dog-caption {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.choice-card {
  position: relative;
  flex: 0 0 auto;
  width: 220px;
  height: 220px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  scroll-snap-align: center;
  transition: opacity .6s ease, transform .6s var(--ease), width .5s var(--ease), height .5s var(--ease), border-radius .5s var(--ease), background .5s ease;
  will-change: opacity, transform;
  transform-style: preserve-3d;
}

.choice-card::before,
.choice-card::after { content: none; }

.choice-card:hover {
  transform: translate3d(0,-8px,0);
  background: var(--soft);
}

/* 卡片正反面 */
.card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
  transition: opacity .3s ease;
}

.card-front {
  background: var(--bg);
  z-index: 2;
  opacity: 1;
}

.card-back {
  transform: rotateY(180deg);
  background: var(--soft);
  z-index: 1;
  opacity: 0;
}

/* 翻转动画 */
.choice-card.flipped {
  transform: rotateY(180deg);
  background: transparent;
}

.choice-card.flipped .card-front {
  z-index: 1;
  opacity: 0;
}

.choice-card.flipped .card-back {
  z-index: 2;
  opacity: 1;
}

.choice-card.flipped:hover {
  transform: rotateY(180deg);
}

/* 卡片内文字：flex column + align-items:center 居中 */
.choice-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--ink);
  font-size: 36px;
  font-weight: 900;
  line-height: 1.24;
  text-align: center;
}

.choice-text .line {
  display: block;
  white-space: nowrap;
}

.mini-icon {
  margin-top: 12px;
  width: 40px;
  height: 40px;
}

/* 卡背名称（食材/烹饪方法/菜品/调味） */
.back-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--ink);
  font-size: 32px;
  font-weight: 900;
  line-height: 1.24;
  text-align: center;
  margin-bottom: 8px;
}

.back-name .line {
  display: block;
  white-space: nowrap;
}

/* 卡背揭示文字 */
.reveal-text {
  display: block;
  padding: 0 14px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: break-word;
  hyphens: none;
}

/* ===== 英文模式卡片文字适配 ===== */
html[lang="en"] .choice-text {
  font-size: 20px;
  word-break: keep-all;
  overflow-wrap: break-word;
}
html[lang="en"] .choice-text .line {
  white-space: normal;
}
html[lang="en"] .back-name {
  font-size: 20px;
  word-break: keep-all;
  overflow-wrap: break-word;
}
html[lang="en"] .back-name .line {
  white-space: normal;
}

.mini-icon svg,
.marker svg,
.face-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.choice-card.faded {
  opacity: 0;
  transform: scale(.74);
  pointer-events: none;
}

.choice-card.selected {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  transform: translate3d(var(--fly-x), var(--fly-y), 0) scale(.82) rotateY(180deg);
  opacity: 0;
  pointer-events: none;
}

.choice-card.selected .choice-text,
.choice-card.selected .mini-icon { opacity: 0; }
.choice-card.selected .reveal-text { opacity: 0; }

/* 面包屑：left:50% + translateX(-50%) 水平居中 */
.crumbs {
  position: absolute;
  left: 50%;              /* 水平居中 */
  bottom: 320px;
  width: 1080px;
  max-width: calc(100% - 8%);
  text-align: center;     /* 文字居中 */
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
  transform: translateX(-50%); /* 自身宽度回拉居中 */
}

/* "点击卡片开始下一步"提示 */
.next-tip {
  position: absolute;
  left: 50%;
  top: 56%;
  transform: translateX(-50%);
  color: var(--ink);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease, visibility .5s ease;
  pointer-events: none;
  z-index: 15;
}

.next-tip.show {
  opacity: 1;
  visibility: visible;
}

/* ===== 边角固定元素（不参与居中） ===== */
/* 右上角吐槽按钮：fixed 固定在视口右上角 */
.contact {
  position: fixed;
  right: 64px;             /* 往左移，远离右边缘 */
  top: 24px;
  z-index: 1200;
  width: 120px;
  text-align: center;
  pointer-events: none;
}

.contact-btn {
  position: relative;
  display: block;
  width: 80px;
  height: 80px;
  margin: 0 auto;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--bg);
  cursor: pointer;
  pointer-events: auto;
  transition: border-color .25s ease, background .25s ease;
}

.contact-btn::before,
.contact-btn::after {
  content: "";
  position: absolute;
  top: 28px;
  width: 9px;
  height: 2px;
  background: var(--ink);
  transition: background .25s ease;
}

.contact-btn::before { left: 23px; transform: rotate(25deg); }
.contact-btn::after { right: 23px; transform: rotate(-25deg); }

.angry-mouth {
  position: absolute;
  left: 27px;
  top: 49px;
  width: 26px;
  height: 12px;
  border-top: 2px solid var(--ink);
  border-radius: 50%;
  transition: border-color .25s ease;
}

.contact-btn.active {
  border-color: #d62222;
  background: #d62222;
}

.contact-btn.active::before,
.contact-btn.active::after {
  background: #fff;
}

.contact-btn.active .angry-mouth {
  border-top-color: #fff;
}

.contact-bubble {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
  pointer-events: auto;
  cursor: pointer;
}

/* 联系弹窗：fixed 全屏 + grid place-items 居中面板 */
.contact-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;    /* grid 居中 .contact-panel */
  background: rgba(0, 0, 0, .38);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}

.contact-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* 面板占视口 75%，可滚动 */
.contact-panel {
  position: relative;
  width: 75vw;
  height: 75vh;
  max-width: 1200px;
  max-height: 900px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--bg);
  overflow: hidden;
  transform: translate3d(0,12px,0) scale(.96);
  transition: transform .4s var(--ease);
  box-shadow: 0 30px 80px rgba(0,0,0,.16);
}

.contact-overlay.open .contact-panel {
  transform: translate3d(0,0,0) scale(1);
}

/* 面板内部滚动区 */
.contact-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 48px 56px 56px;
  scroll-behavior: smooth;
}

.contact-scroll::-webkit-scrollbar {
  width: 6px;
}

.contact-scroll::-webkit-scrollbar-thumb {
  background: var(--rule);
  border-radius: 3px;
}

/* 顶部：手绘照片 + 创作者名称，水平排列 */
.creator-header {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 40px;
}

/* 火柴人微笑大头照 */
.creator-photo {
  position: relative;
  width: 140px;
  height: 140px;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--soft);
  overflow: hidden;
}

/* 大头：居中放大 */
.cp-head {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 88px;
  height: 88px;
  margin-left: -44px;
  margin-top: -44px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--bg);
}

.cp-eye {
  position: absolute;
  top: 30px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}

.cp-eye.left { left: 22px; }
.cp-eye.right { right: 22px; }

/* 微笑弧线 */
.cp-smile {
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: 36px;
  height: 18px;
  margin-left: -18px;
  border: 2px solid var(--ink);
  border-top: none;
  border-radius: 0 0 36px 36px;
}

.creator-name {
  margin: 0;
  color: var(--ink);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.35;
}

/* 内容区块 */
.contact-section {
  margin-bottom: 36px;
}

/* 创作者简介：手写感 */
.creator-intro .contact-section-title {
  font-size: 24px;
  color: var(--muted);
}

.creator-intro .contact-section-text {
  font-family: KaiTi, STKaiti, FangSong, "Microsoft YaHei", cursive;
  font-size: 20px;
  line-height: 2.1;
  color: var(--ink);
}

.contact-section-title {
  margin: 0 0 16px;
  color: var(--ink);
  font-family: KaiTi, STKaiti, FangSong, "Microsoft YaHei", cursive;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
}

.contact-section-text {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 2;
  letter-spacing: .5px;
}

/* 底部联系方式 */
.contact-methods {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 44px;
  padding-top: 36px;
  border-top: 1px solid var(--rule);
}

.contact-methods .info-bubble {
  position: static;
  min-width: auto;
}

/* 联系方式胶囊标签 */
.info-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
}

/* 超链接按钮动效 */
.link-bubble {
  text-decoration: none;
  cursor: pointer;
  border-color: var(--ink);
  font-weight: 700;
  transition: transform .3s var(--ease), background .3s ease, color .3s ease, box-shadow .3s ease;
  animation: linkFloat 2.4s ease-in-out infinite;
}

.link-bubble:nth-of-type(2) { animation-delay: .3s; }
.link-bubble:nth-of-type(3) { animation-delay: .6s; }

.link-bubble:hover {
  transform: translateY(-6px) scale(1.06);
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}

.link-bubble:active {
  transform: translateY(-2px) scale(1.02);
}

@keyframes linkFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.close-contact {
  position: absolute;
  right: 18px;
  top: 16px;
  width: 24px;
  height: 24px;
  border: 1px solid #d62222;
  border-radius: 50%;
  cursor: pointer;
  color: #d62222;
  line-height: 24px;
  z-index: 10;
}

.close-contact::before,
.close-contact::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 4px;
  width: 2px;
  height: 14px;
  border-radius: 2px;
  background: #d62222;
}

.close-contact::before { transform: rotate(45deg); }
.close-contact::after { transform: rotate(-45deg); }

/* 左下角"重新开始"按钮：fixed 固定在视口左下角 */
.restart {
  position: fixed;
  right: 24px;
  bottom: 84px;
  z-index: 900;
  color: var(--muted);
  padding: 10px 22px 11px;
  border: 2px solid currentColor;
  border-radius: 58% 42% 54% 46% / 47% 58% 42% 53%;
  background: rgba(255,255,255,.86);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease, color .3s ease, transform .3s var(--ease), background .3s ease;
}

/* 显示规则 */
.phase-select .restart,
.phase-result .restart,
.restart.show-in-combo {
  opacity: 1;
  pointer-events: auto;
}

/* 套餐页时右侧按钮左移，避开滚动条 */
.restart.show-in-combo {
  right: 40px;
}
.translate-btn.show-in-combo {
  right: 40px;
}

.restart:hover {
  color: var(--ink);
  background: var(--bg);
  transform: rotate(-2deg) translateY(-2px);
}

/* "返回上一步"按钮：左下角，仅在 phase-select 且 stepIndex>0 时显示 */
.back-step {
  position: fixed;
  left: 24px;
  bottom: 84px;
  z-index: 900;
  color: var(--muted);
  padding: 10px 22px 11px;
  border: 2px solid currentColor;
  border-radius: 42% 58% 46% 54% / 58% 47% 53% 42%;
  background: rgba(255,255,255,.86);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease, color .3s ease, transform .3s var(--ease), background .3s ease;
}
.back-step.show {
  opacity: 1;
  pointer-events: auto;
}
.back-step:hover {
  color: var(--ink);
  background: var(--bg);
  transform: rotate(2deg) translateY(-2px);
}

.result-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 0 0 260px;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox: 隐藏滚动条，避免横屏与符号重叠 */
  -ms-overflow-style: none;
}
.result-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari: 隐藏滚动条 */
}

/* 结果卡片：margin auto 水平居中 */
.result-card {
  position: relative;
  width: 300px;
  height: 400px;
  margin: 340px auto 0;   /* auto 左右边距居中 */
  cursor: pointer;
  perspective: 1200px;
  transition: margin-top .78s var(--ease);
}

.phase-result .result-card {
  animation: cardFromPlanet .78s var(--ease) both;
}

.phase-result .result-page.revealed .result-card {
  margin-top: 72px;
}

.card-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .8s var(--ease);
  will-change: transform;
}

.result-card.flipped .card-inner { transform: rotateY(180deg); }

.result-card .card-face {
  position: absolute;
  inset: 0;
  border: 1px solid var(--rule);
  border-radius: 22px;
  overflow: hidden;
  background: var(--bg);
  transition: opacity .4s ease;
}

.result-card .card-front {
  display: grid;
  place-items: center;    /* grid 单格居中：内容在卡片正面居中 */
  opacity: 1;
  z-index: 2;
}

.result-card.flipped .card-front {
  opacity: 0;
  z-index: 1;
}

.dish-art {
  width: 100%;
  height: 100%;
  display: none;
}

.final-card-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
}

.final-card-planet {
  position: absolute;
  left: 50%;              /* 在结果卡片中水平居中 */
  bottom: -70px;
  z-index: 1;
  width: 240px;
  height: 240px;
  border: 2px solid var(--planet);
  border-radius: 50%;
  transform: translateX(-50%); /* 自身宽度回拉居中 */
  background: var(--bg);
}

.final-card-planet::before,
.final-card-planet::after {
  content: "";
  position: absolute;
  left: 34px;
  width: 172px;
  height: 42px;
  border: 2px solid var(--planet);
  border-left-color: transparent;
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(-15deg);
}

.final-card-planet::before { top: 64px; }
.final-card-planet::after { top: 132px; left: 52px; width: 136px; opacity: .68; }

.final-stick {
  position: absolute;
  top: 116px;
  z-index: 2;
  width: 38px;
  height: 52px;
  color: var(--ink);
  animation: finalWalk .8s linear infinite;
}

.final-stick.left { left: 108px; }
.final-stick.right { right: 108px; }

.final-stick .fs-head {
  position: absolute;
  left: 7px;
  top: 0;
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: var(--bg);
}

.final-stick .fs-head::before,
.final-stick .fs-head::after {
  content: "";
  position: absolute;
  top: 9px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.final-stick .fs-head::before { left: 6px; }
.final-stick .fs-head::after { right: 6px; }

.final-stick .fs-body {
  position: absolute;
  left: 18px;
  top: 25px;
  width: 2px;
  height: 22px;
  border-radius: 3px;
  background: currentColor;
}

.final-stick .fs-arm,
.final-stick .fs-leg {
  position: absolute;
  height: 2px;
  border-radius: 4px;
  background: currentColor;
}

.final-stick .fs-arm { top: 32px; width: 14px; }
.final-stick .fs-arm.left { left: 5px; transform-origin: right center; animation: leftWalkArm .8s linear infinite; }
.final-stick .fs-arm.right { left: 19px; transform-origin: left center; animation: rightWalkArm .8s linear infinite; }
.final-stick .fs-leg { top: 45px; width: 13px; }
.final-stick .fs-leg.left { left: 7px; transform-origin: right center; animation: leftWalkLeg .8s linear infinite; }
.final-stick .fs-leg.right { left: 18px; transform-origin: left center; animation: rightWalkLeg .8s linear infinite; }

.final-card-hearts {
  position: absolute;
  left: 50%;              /* 在结果卡片中水平居中 */
  top: 92px;
  z-index: 3;
  width: 78px;
  height: 34px;
  transform: translateX(-50%); /* 自身宽度回拉居中 */
  animation: heartsFloat 1.6s ease-in-out infinite;
}

.final-card-hearts::before,
.final-card-hearts::after {
  content: "\2661";
  position: absolute;
  color: #f0a7ba;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 10px rgba(240,167,186,.22);
}

.final-card-hearts::before { left: 14px; top: 8px; }
.final-card-hearts::after { right: 10px; top: 0; font-size: 28px; }

.final-card-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  z-index: 4;
  padding: 0 22px;
  font-family: KaiTi, STKaiti, FangSong, "Microsoft YaHei", cursive;
  font-size: 24px;
  line-height: 1.25;
  text-align: center;     /* 文字在结果卡片中水平居中 */
  color: var(--ink);
}

@keyframes cardFromPlanet {
  0% { opacity: 0; transform: translate3d(0,230px,0) scale(.58); }
  100% { opacity: 1; transform: translate3d(0,0,0) scale(1); }
}

/* phase-skip：直接看结果的过渡动画 */
/* 小球+小人从底部移动到屏幕中央并缩小淡出 */
.phase-skip .planet-system {
  transform: translate3d(715px, -210px, 0) scale(.5);
  opacity: 0;
  transition: transform 1.8s var(--ease), opacity 1.2s ease .8s;
}

/* 隐藏 gate 页面和首页标题，立即隐藏不参与过渡 */
.phase-skip .gate-page,
.phase-skip .hero {
  opacity: 0 !important;
  visibility: hidden !important;
  transition: none !important;
}

.phase-skip .hero-title span {
  opacity: 0 !important;
  transition: none !important;
}

/* 结果卡片从中央放大出现 */
.phase-skip .result-page {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0,0,0);
}

/* phase-skip 期间只显示卡片，隐藏其他文字 */
.phase-skip .flip-tip,
.phase-skip .module {
  opacity: 0 !important;
  visibility: hidden;
}

.phase-skip .result-card {
  margin-top: 340px;
  animation: skipCardAppear 1.6s var(--ease) .6s both;
}

@keyframes skipCardAppear {
  0% { opacity: 0; transform: translate3d(0, 180px, 0) scale(.4); }
  50% { opacity: 1; transform: translate3d(0, 0, 0) scale(1.05); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes finalWalk {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.marker {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  width: 30px;
  height: 30px;
  opacity: .9;
}

.result-card .card-back {
  display: grid;
  place-items: center;    /* grid 单格居中：背面文字内容居中 */
  padding: 30px;
  transform: rotateY(180deg);
  opacity: 0;
  z-index: 1;
}

.result-card.flipped .card-back {
  opacity: 1;
  z-index: 2;
}

.dish-name {
  margin: 0 0 14px;
  font-family: KaiTi, STKaiti, FangSong, "Microsoft YaHei", cursive;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.25;
}

.story {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
}

/* 翻转提示：text-align:center 居中 */
.flip-tip {
  margin-top: 20px;
  text-align: center;     /* 文字居中 */
  color: var(--muted);
  font-size: 16px;
  opacity: 0;
  transform: translate3d(0,16px,0);
  transition: opacity .6s ease, transform .6s var(--ease);
  pointer-events: none;
}

.result-page.revealed .flip-tip {
  opacity: 1;
  transform: translate3d(0,0,0);
}

/* 菜谱/评价模块：margin auto 水平居中 */
.module {
  width: 820px;
  margin: 60px auto 0;    /* auto 左右边距居中 */
  padding: 34px 40px;
  border: 1px solid var(--rule);
  border-radius: 22px;
  background: var(--bg);
  opacity: 0;
  transform: translate3d(0,36px,0);
  transition: opacity .8s ease, transform .8s var(--ease);
}

#recipeModule { margin-top: 60px; }
#reviewModule { margin-bottom: 320px; }

.module.visible {
  opacity: 1;
  transform: translate3d(0,0,0);
}

.module h2 {
  margin: 0 0 22px;
  font-family: KaiTi, STKaiti, FangSong, "Microsoft YaHei", cursive;
  font-size: 32px;
  font-weight: 400;
}

.module li,
.module p {
  color: var(--muted);
  font-size: 18px;
  line-height: 2;
}

.module ol { margin: 0; padding-left: 24px; }

/* ========== 翻译按钮 - 手绘风格 ========== */
.translate-btn {
  position: fixed;
  bottom: 24px;
  right: 34px;
  z-index: 900;
  padding: 10px 22px 11px;
  border: 2px solid var(--muted);
  border-radius: 54% 46% 47% 53% / 42% 58% 42% 58%;
  background: rgba(255,255,255,.86);
  color: var(--muted);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: color .3s ease, background .3s ease, transform .3s ease;
}
.translate-btn:hover {
  color: var(--ink);
  background: var(--bg);
  transform: rotate(2deg) translateY(-2px);
}
.translate-btn.active {
  color: var(--ink);
  background: var(--soft);
}

/* ========== 背景切换按钮 - 手绘风格 ========== */
.bg-switch-btn {
  position: fixed;
  bottom: 80px;
  right: 34px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px 9px;
  border: 2px solid var(--muted);
  border-radius: 52% 48% 54% 46% / 58% 42% 58% 42%;
  background: rgba(255,255,255,.86);
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: color .3s ease, background .3s ease, transform .3s ease;
}
.bg-switch-btn:hover {
  color: var(--ink);
  background: var(--bg);
  transform: rotate(-2deg) translateY(-2px);
}
.bg-switch-icon { font-size: 18px; line-height: 1; }

/* 三种背景模式 */
body.bg-mode-blank {
  background-image: none;
}
body.bg-mode-lines {
  background-image:
    linear-gradient(rgba(120, 100, 60, 0.15) 1px, transparent 1px);
  background-size: 48px 48px;
}
body.bg-mode-grid {
  background-image:
    linear-gradient(rgba(120, 100, 60, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 100, 60, 0.15) 1px, transparent 1px);
  background-size: 48px 48px;
}
.translate-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  backdrop-filter: blur(6px);
}
.translate-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ========== 翻译弹窗 ========== */
.translate-modal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 480px;
  width: 88%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 56px rgba(0,0,0,0.25);
  transform: translateY(16px);
  transition: transform 0.35s ease;
}
.translate-overlay.open .translate-modal {
  transform: translateY(0);
}
.translate-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}
.translate-desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 10px;
}
.translate-desc.en {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  margin-bottom: 0;
}
.translate-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  opacity: 0.6;
  font-style: italic;
  text-align: center;
  margin: 8px 0 0;
}
.translate-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}
.translate-actions button {
  padding: 8px 24px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.translate-cancel {
  background: transparent;
  color: var(--muted);
}
.translate-cancel:hover {
  background: var(--line);
  color: var(--text);
}
.translate-confirm {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent) !important;
}
.translate-confirm:hover {
  opacity: 0.85;
}

/* ========== 桌面端翻转卡片放大居中（同竖屏版逻辑） ========== */
@media (min-width: 769px) {
  .choice-card.flipped {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    width: 80vw !important;
    max-width: 520px !important;
    min-height: 280px !important;
    height: auto !important;
    padding: 0 !important;
    border-radius: 18px !important;
    transform: translate(-50%, -50%) rotateY(180deg) !important;
    z-index: 50;
    background: var(--card) !important;
    box-shadow: 0 12px 60px rgba(0,0,0,.18);
  }
  .choice-card.flipped .card-face.card-front { position: absolute; inset: 0; }
  .choice-card.flipped .card-face.card-back { padding: 32px 30px; }
  .choice-card.flipped .back-name { font-size: 22px; line-height: 1.4; }
  .choice-card.flipped .reveal-text { font-size: 16px; line-height: 1.7; padding: 0; }
  .choice-card.flipped.faded { display: none; }
}

/* ========== 菜单按钮（全局合并） ========== */
.menu-btn {
  display: block;
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 960;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: rgba(255,255,255,.9);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all .2s ease;
}
.menu-btn:active { background: var(--ink); color: var(--bg); }

/* 全局隐藏原按钮，用 ☰ 菜单替代 */
.contact, .translate-btn, .bg-switch-btn, .fullscreen-btn, .gallery-fab { display: none !important; }

.menu-dropdown {
  display: none;
  position: fixed;
  top: 62px;
  right: 12px;
  z-index: 960;
  background: rgba(255,255,255,.96);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 6px;
  min-width: 180px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  flex-direction: column;
  gap: 2px;
}
.menu-dropdown.show { display: flex; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: none;
  background: none;
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: background .15s ease;
  min-height: 44px;
}
.menu-item:first-child { font-size: 18px; }
.menu-item:hover, .menu-item:active { background: rgba(0,0,0,.06); }
.menu-item-label { flex: 1; }

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
  /* 基础调整 */
  html { font-size: 14px; }
  * { -webkit-tap-highlight-color: transparent; }
  body { overflow-x: hidden; }

  /* 全局消除 300ms 触摸延迟 */
  button, a, [role="button"], .option, .planet-wrap, #dogHandle,
  #startLifeBtn, #randomPickBtn, #needDrinkBtn, #skipResultBtn,
  .choice-card, .adv-choice-btn, .start-btn, .roller-item,
  .more-plays-item, .gallery-item, .gallery-filter-btn, .gallery-close {
    touch-action: manipulation;
  }

  /* 滚动容器平滑滚动 */
  #trackWrap, #resultScroll, .contact-panel, .translate-modal {
    overflow-y: auto;
    -webkit-overflow-scrolling: auto;
  }

  /* 全屏按钮 - 缩小防遮挡 */
  .fullscreen-btn {
    width: 28px; height: 28px; top: 6px; right: 6px; font-size: 13px;
  }

  /* 联系按钮和气泡 */
  .contact-btn {
    width: 36px; height: 36px; bottom: calc(70px + var(--safe-bottom)); right: 10px; font-size: 16px;
  }
  .contact-bubble {
    bottom: calc(112px + var(--safe-bottom)); right: 10px; padding: 5px 10px; font-size: 11px; max-width: 160px;
  }
  .contact-panel {
    width: 90vw; max-width: 380px; padding: 20px; border-radius: 14px;
    max-height: 75vh;
  }
  .contact-panel h3 { font-size: 16px; }
  .contact-panel h4 { font-size: 14px; }
  .contact-panel p { font-size: 13px; line-height: 1.5; }

  /* 翻译按钮 */
  .translate-btn {
    width: 36px; height: 36px; bottom: calc(10px + var(--safe-bottom)); right: 10px; font-size: 14px;
  }

  /* 翻译弹窗 */
  .translate-modal {
    padding: 20px 16px; max-width: 92%; border-radius: 14px;
  }
  .translate-title { font-size: 16px; margin-bottom: 10px; }
  .translate-desc { font-size: 13px; line-height: 1.55; }
  .translate-actions button { padding: 7px 16px; font-size: 13px; border-radius: 8px; }

  /* 小狗滑块说明 */
  .dog-caption { font-size: 11px; bottom: 12px; left: 10px; }

  /* 结果页 */
  .result-page { padding: 12px; }
  .result-card { max-height: 55vh; }

  /* 结果模块 */
  .module {
    width: 88vw; max-width: 500px; padding: 14px 12px; border-radius: 12px;
  }
  .module h2 { font-size: 14px; }
  .module li { font-size: 12px; line-height: 1.5; }
  .module li strong { font-size: 12px; }

  /* 菜名 */
  #dishName { font-size: 18px; }

  /* 重新开始按钮 */
  #restartBtn { font-size: 12px; padding: 6px 18px; }

  /* 下一步提示 */
  #nextTip { font-size: 12px; bottom: 4px; }
}

@media (orientation: portrait) and (max-width: 1024px) {
  html, body { width: 100%; height: auto; min-height: 100%; }
  body {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    display: block;
    align-items: stretch;
    justify-content: stretch;
    /* 移动端安全区域 */
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
  }
  .viewport {
    position: static !important;
    display: block !important;
    width: 100%;
    height: auto;
    min-height: 100vh;
    place-items: stretch;
    place-content: stretch;
    overflow: visible !important;
  }
  .app {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100vh;
    transform: none;
    overflow: visible !important;
    justify-self: stretch;
    align-self: stretch;
    margin: 0 !important;
  }
  .symbols { display: none !important; }
  .start-hit { z-index: 5; display: none; }
  .app:not(.phase-gate):not(.phase-zoom):not(.phase-select):not(.phase-result):not(.phase-skip):not(.phase-adventure) .start-hit { display: block; }

  .planet-system {
    position: fixed !important;
    left: 50% !important;
    top: auto !important;
    bottom: calc(-70px + var(--safe-bottom)) !important;
    width: 250px !important;
    height: 286px !important;
    margin: 0 !important;
    transform: translateX(-50%) scale(0.28) !important;
    transform-origin: center bottom !important;
    opacity: 0.55 !important;
    pointer-events: none;
    z-index: 800;
  }
  /* 竖屏下滚轮静止摆正，小人原地踏步 */
  .rotor { animation: none !important; }
  .thinker { transform: translate3d(-50%, 0, 0) !important; }
  .head { animation: headWalk 2.4s ease-in-out infinite !important; }
  .arm, .leg { animation-duration: 2.4s !important; }

  /* contact移到左上角，避免和adv-exit-btn重叠 */
  .contact { right: auto; left: 10px; top: 10px; width: auto; z-index: 950; pointer-events: auto; }
  .contact-btn {
    width: 44px;
    height: 44px;
    border-width: 1.5px;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    cursor: pointer;
    pointer-events: auto;
  }
  .contact-btn::before, .contact-btn::after { top: 16px; width: 7px; height: 2.5px; }
  .contact-btn::before { left: 12px; }
  .contact-btn::after { right: 12px; }
  .angry-mouth { left: 14px; top: 27px; width: 16px; height: 7px; border-top-width: 1.5px; }
  .contact-bubble {
    display: block;
    margin-top: 4px;
    color: var(--ink);
    font-size: 11px;
    line-height: 1.25;
    text-align: center;
    max-width: 90px;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    padding: 0;
  }
  .translate-btn { right: 12px; bottom: calc(12px + var(--safe-bottom)); font-size: 15px; padding: 10px 16px; z-index: 930; }
  .bg-switch-btn { right: 12px; bottom: calc(54px + var(--safe-bottom)); font-size: 13px; padding: 7px 12px; z-index: 930; }
  .gallery-fab { left: 12px; bottom: calc(12px + var(--safe-bottom)); font-size: 15px; padding: 10px 16px; z-index: 930; }

  .restart {
    position: fixed !important;
    right: 12px !important;
    bottom: calc(100px + var(--safe-bottom)) !important;
    top: auto !important;
    left: auto !important;
    display: block;
    width: max-content;
    margin: 0 !important;
    font-size: 13px;
    padding: 8px 14px;
    z-index: 940;
  }
  .app:not(.phase-select):not(.phase-result):not(.phase-skip) .restart:not(.show-in-combo) { display: none; }
  .restart.show-in-combo { right: 12px !important; bottom: calc(100px + var(--safe-bottom)) !important; }
  .translate-btn.show-in-combo { right: 12px !important; bottom: calc(12px + var(--safe-bottom)) !important; }

  .back-step {
    position: fixed !important;
    left: 12px !important;
    bottom: calc(54px + var(--safe-bottom)) !important;
    top: auto !important;
    right: auto !important;
    display: block;
    width: max-content;
    margin: 0 !important;
    font-size: 13px;
    padding: 8px 14px;
    z-index: 940;
  }

  .app.phase-gate .hero,
  .app.phase-select .hero,
  .app.phase-result .hero,
  .app.phase-skip .hero { display: none; }
  .app:not(.phase-gate) .gate-page { display: none; }
  .app:not(.phase-select) .select-page { display: none; }
  .app:not(.phase-result):not(.phase-skip) .result-page { display: none; }
  .app.phase-zoom .hero { opacity: 1; visibility: visible; }

  .hero {
    position: static !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 0 20px 76px;
    transform: none !important;
  }
  .hero-title {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 12px;
    width: 100%;
    padding: 0;
    font-size: 42px;
    letter-spacing: 2px;
    line-height: 1.15;
  }
  .hero-subtitle { margin-top: 20px; font-size: 15px; line-height: 1.6; }
  .tap-guide {
    position: fixed !important;
    left: 50%;
    bottom: calc(150px + var(--safe-bottom));
    transform: translateX(-50%);
    width: max-content;
    text-align: center;
    font-size: 14px;
    letter-spacing: 4px;
    white-space: normal;
    margin: 0;
    animation: tapPulseP 1.6s ease-in-out infinite;
    z-index: 12;
  }
  @keyframes tapPulseP { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

  .gate-page {
    position: static !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 60px 20px 100px;
    inset: auto;
    box-sizing: border-box;
  }
  .start-prompt { font-size: 19px; letter-spacing: 1px; text-align: center; padding-left: 0; }
  .start-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    width: 100%;
    max-width: 340px;
    margin-top: 28px;
    padding: 0;
    justify-content: center;
  }
  .start-btn {
    height: auto;
    min-height: 56px;
    border-radius: 40px;
    font-size: 16px;
    padding: 14px 12px;
    border-width: 2px;
  }
  /* 前两个按钮并排，第三个拉宽居中 */
  .start-buttons #startLifeBtn,
  .start-buttons #adventureBtn {
    flex: 1 1 calc(50% - 7px);
    min-width: 0;
  }
  .start-buttons #skipResultBtn {
    flex: 1 1 100%;
    width: 100%;
  }
  .gate-explain { font-size: 13px; margin-top: 24px; padding: 0 6px; letter-spacing: 1px; line-height: 1.7; }

  .select-page {
    position: static !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    min-height: 100vh;
    padding: 24px 16px 70px;
    inset: auto;
  }
  .question {
    position: static !important;
    width: 100%;
    padding: 0 0 8px;
    margin: 0;
    font-size: 20px;
    letter-spacing: 1px;
    text-align: center;
    transform: none;
    left: auto;
    top: auto;
    order: 1;
  }
  .track-wrap {
    position: static !important;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    max-width: none;
    max-height: 290px;
    padding: 4px 4px 8px;
    overflow-x: hidden;
    overflow-y: auto;
    transform: none !important;
    left: auto;
    top: auto;
  }
  .cards-area {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    order: 3;
  }
  .dog-slider {
    position: relative !important;
    flex: 0 0 36px;
    width: 36px;
    height: auto;
    align-self: stretch;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    pointer-events: none;
    opacity: 0;
    transition: opacity .35s ease;
  }
  .dog-slider.visible { opacity: 1; pointer-events: auto; }
  .dog-slider::before {
    left: 50% !important;
    right: auto !important;
    top: 8px;
    bottom: 8px;
    width: 1px;
    height: auto;
    transform: translateX(-50%);
  }
  .dog-handle {
    left: 50% !important;
    top: 0;
    width: 74px;
    height: 34px;
    transform: translateX(-50%) !important;
    transition: top .12s linear;
  }
  .dog-handle.dragging { transition: none; }
  .dog-caption { display: none; }
  .track {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 0;
    margin: 0;
    justify-content: flex-start;
    perspective: none;
  }
  .choice-card {
    width: 100%;
    min-height: 50px;
    height: auto;
    padding: 8px 10px;
    border-radius: 10px;
    perspective: 800px;
  }
  .choice-card:hover { transform: none; }
  .card-face.card-front {
    position: static;
    inset: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 4px 4px;
  }
  .card-face.card-back { position: absolute; inset: 0; padding: 14px 12px; }
  .choice-text {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 2px;
    column-gap: 0;
    font-size: 15px;
    line-height: 1.25;
    text-align: left;
    flex: 1 1 auto;
    min-width: 0;
  }
  .choice-text .line { white-space: nowrap; }
  .back-name { font-size: 18px; gap: 2px; line-height: 1.3; margin-bottom: 4px; }
  .reveal-text { font-size: 13px; line-height: 1.55; padding: 0 4px; }
  .mini-icon { width: 22px; height: 22px; margin-top: 0; flex: 0 0 auto; }

  .choice-card.flipped {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    width: 86vw !important;
    max-width: 360px !important;
    min-height: 240px !important;
    height: auto !important;
    padding: 0 !important;
    border-radius: 18px !important;
    transform: translate(-50%, -50%) rotateY(180deg) !important;
    z-index: 50;
  }
  .choice-card.flipped .card-face.card-front { position: absolute; inset: 0; }
  .choice-card.flipped .card-face.card-back { padding: 24px 22px; }
  .choice-card.flipped .back-name { font-size: 21px; line-height: 1.3; }
  .choice-card.flipped .reveal-text { font-size: 15px; line-height: 1.65; padding: 0; }
  .choice-card.flipped.faded { display: none; }

  .crumbs {
    position: static !important;
    width: 100%;
    max-width: 100%;
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
    transform: none;
    left: auto;
    bottom: auto;
    order: 4;
  }
  .next-tip {
    position: static !important;
    width: 100%;
    margin: 2px 0 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    transform: none;
    left: auto;
    right: auto;
    bottom: auto;
    top: auto;
    z-index: auto;
    order: 2;
  }

  .result-page {
    position: static !important;
    display: block;
    padding: 16px 16px 70px;
    inset: auto;
    transform: none !important;
  }
  .result-scroll {
    position: static !important;
    inset: auto;
    height: auto;
    overflow: visible;
    padding: 0;
  }
  .app.phase-skip .result-card,
  .app.phase-result .result-card,
  .app.phase-result .result-page.revealed .result-card {
    margin: 0 auto 20px !important;
  }
  .result-card {
    width: min(300px, calc(100vw - 40px));
    height: auto;
    aspect-ratio: 3 / 4;
    max-height: 72vh;
  }
  .dish-name { font-size: 22px; }
  .story { font-size: 14px; line-height: 1.8; }
  .flip-tip { margin-top: 18px; font-size: 13px; }
  .module {
    width: 100%;
    max-width: 560px;
    margin: 16px auto !important;
    padding: 20px 16px;
    border-radius: 16px;
  }
  .module h2 { font-size: 22px; margin-bottom: 14px; }
  .module li, .module p { font-size: 14px; line-height: 1.8; }
  .module ol { padding-left: 20px; }

  .contact-panel {
    width: 92vw !important;
    max-width: 420px;
    height: 82vh;
    max-height: 760px;
    border-radius: 16px;
  }
  .contact-scroll { padding: 28px 24px 32px; }
  .creator-header { gap: 18px; margin-bottom: 24px; }
  .creator-photo { width: 84px; height: 84px; }
  .cp-head { width: 56px; height: 56px; margin-left: -28px; margin-top: -28px; }
  .cp-eye { top: 18px; }
  .cp-eye.left { left: 14px; }
  .cp-eye.right { right: 14px; }
  .cp-smile { width: 22px; height: 10px; margin-left: -11px; bottom: 12px; }
  .creator-name { font-size: 24px; }
  .contact-section { margin-bottom: 22px; }
  .contact-section-title { font-size: 19px; margin-bottom: 10px; }
  .contact-section-text { font-size: 14px; line-height: 1.8; }
  .creator-intro .contact-section-title { font-size: 17px; }
  .creator-intro .contact-section-text { font-size: 14px; line-height: 1.9; }
  .contact-methods { gap: 12px; margin-top: 24px; padding-top: 20px; }
  .info-bubble { height: 38px; padding: 0 16px; font-size: 13px; }

  .translate-modal {
    width: 92%;
    max-width: 420px;
    padding: 22px 18px;
    border-radius: 16px;
  }
  .translate-title { font-size: 16px; }
  .translate-desc { font-size: 13px; }
}

/* ========================================
   图鉴 · 无边画布（无边记 / Freeform 风格）
   ======================================== */
.gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background-color: #fff;
  background-image:
    linear-gradient(rgba(120, 100, 60, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 100, 60, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  font-family: "KaiTi", "STKaiti", "FangSong", "Noto Sans SC", cursive, sans-serif;
}
.gallery-overlay.open { display: flex; }

/* 顶部工具栏 */
.gallery-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(40, 36, 28, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  z-index: 10;
  flex-shrink: 0;
  color: #f3ede0;
}
.gallery-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  font-family: "KaiTi", "STKaiti", "FangSong", "Noto Sans SC", cursive, sans-serif;
  flex-shrink: 0;
  color: #f3ede0;
}
.gallery-filter {
  display: flex;
  gap: 6px;
  flex: 1;
  flex-wrap: wrap;
}
.gallery-filter-btn {
  padding: 5px 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 18px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  font-family: "KaiTi", "STKaiti", "Noto Sans SC", cursive, sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.gallery-filter-btn:hover { color: rgba(255, 255, 255, 0.85); border-color: rgba(255, 255, 255, 0.4); }
.gallery-filter-btn.active {
  background: #fff8e8;
  color: #2a2a2a;
  border-color: transparent;
  font-weight: 600;
}
.gallery-close {
  width: 34px; height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.gallery-close:hover { background: rgba(255, 255, 255, 0.3); }

/* 画布容器 */
.gallery-canvas-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.gallery-canvas-wrap.dragging { cursor: grabbing; }
.gallery-canvas-wrap.dragging .gallery-item { pointer-events: none; }

/* 无限画布 */
.gallery-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 1px; height: 1px;
  transform-origin: 0 0;
  will-change: transform;
}

/* 手写字体标签 */
.gallery-item {
  position: absolute;
  cursor: pointer;
  padding: 4px 10px;
  white-space: nowrap;
  user-select: none;
  transform-origin: center center;
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.gallery-item-text {
  display: inline-block;
  font-family: "KaiTi", "STKaiti", "FangSong", "Noto Sans SC", "Caveat", cursive, sans-serif;
  font-style: italic;
  color: #2a2a2a;
  letter-spacing: 1px;
  /* 模拟铅笔/蜡笔手写感：轻微抖动阴影 */
  text-shadow:
    0 0 1px rgba(42, 42, 42, 0.35),
    0.6px 0.6px 0 rgba(60, 50, 35, 0.18);
}
.gallery-item:hover {
  z-index: 50;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}
.gallery-item:hover .gallery-item-text {
  color: #b22222;
  text-shadow: 0 0 1px rgba(178, 34, 34, 0.4);
}
.gallery-item.dim {
  opacity: 0.12;
  pointer-events: none;
}
.gallery-item.cat-dish .gallery-item-text { color: #3a2a1a; }
.gallery-item.cat-drink .gallery-item-text { color: #1f3a4a; }
.gallery-item.cat-dessert .gallery-item-text { color: #4a1f3a; }

/* 提示文字 */
.gallery-hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 14px;
  background: rgba(40, 36, 28, 0.6);
  color: rgba(255, 250, 235, 0.85);
  font-size: 12px;
  font-family: "KaiTi", "STKaiti", "Noto Sans SC", cursive, sans-serif;
  pointer-events: none;
  z-index: 5;
  opacity: 0.85;
  transition: opacity 0.4s ease;
  white-space: nowrap;
}
.gallery-hint.hide { opacity: 0; }

/* 缩放控件 */
.gallery-zoom-controls {
  position: absolute;
  right: 20px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 8;
}
.gallery-zoom-controls button {
  width: 40px; height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(40, 36, 28, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #f3ede0;
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.1s;
  font-family: "KaiTi", "STKaiti", "Noto Sans SC", cursive, sans-serif;
  font-weight: 700;
  line-height: 1;
}
.gallery-zoom-controls button:hover { background: rgba(40, 36, 28, 0.9); }
.gallery-zoom-controls button:active { transform: scale(0.94); }
.gallery-zoom-reset { font-size: 13px !important; width: 44px !important; }

/* 详情弹窗 */
.gallery-detail {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 10, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 30;
  padding: 20px;
}
.gallery-detail.open { display: flex; animation: galleryDetailIn 0.28s ease; }
@keyframes galleryDetailIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.gallery-detail-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 40px; height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  z-index: 2;
}
.gallery-detail-close:hover { background: rgba(255, 255, 255, 0.4); }

.gallery-detail-content {
  max-width: 500px;
  width: 100%;
  max-height: 84vh;
  overflow-y: auto;
  background: #fffdf6;
  border-radius: 14px;
  padding: 26px;
  scrollbar-width: none;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
  animation: galleryCardFlip 0.35s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}
.gallery-detail-content::-webkit-scrollbar { display: none; }
@keyframes galleryCardFlip {
  from { transform: rotateY(70deg) scale(0.85); opacity: 0; }
  to { transform: rotateY(0) scale(1); opacity: 1; }
}

.gallery-detail-art {
  width: 180px;
  margin: 0 auto 14px;
  aspect-ratio: 3/4;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fffef9 0%, #fff5e8 100%);
  position: relative;
}
.gallery-detail-art svg { width: 100%; height: 100%; }

/* 蜡笔风格菜名 */
.crayon-dish-name {
  font-family: "KaiTi", "STKaiti", "FangSong", cursive;
  font-size: 28px;
  font-weight: 700;
  color: #5a3a1a;
  text-shadow:
    1px 1px 0 rgba(90,58,26,0.15),
    2px 2px 0 rgba(90,58,26,0.1);
  transform: rotate(-3deg);
  text-align: center;
  line-height: 1.4;
  padding: 12px;
  word-break: break-all;
}
.gallery-detail-name {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #2a2a2a;
  font-family: "KaiTi", "STKaiti", "FangSong", "Noto Sans SC", cursive, sans-serif;
}
.gallery-detail-intro {
  font-size: 14px;
  line-height: 1.7;
  color: #555;
  margin-bottom: 16px;
}
.gallery-detail-pairs {
  margin-bottom: 16px;
}
.gallery-detail-pairs li {
  font-size: 13px;
  line-height: 1.6;
  color: #666;
  margin-bottom: 6px;
  list-style: none;
}
.gallery-detail-pairs li strong { color: #2a2a2a; }
.gallery-detail-review {
  font-size: 14px;
  line-height: 1.7;
  color: #555;
  font-style: italic;
  border-top: 1px dashed #d8d2c0;
  padding-top: 14px;
}

/* 常驻图鉴小按钮 - 手绘风格 */
.gallery-fab {
  position: fixed;
  bottom: 24px; left: 34px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px 11px;
  border: 2px solid var(--muted);
  border-radius: 58% 42% 54% 46% / 47% 58% 42% 53%;
  background: rgba(255,255,255,.86);
  color: var(--muted);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  z-index: 9999;
  user-select: none;
  transition: color .3s ease, background .3s ease, transform .3s ease;
}
.gallery-fab:hover {
  color: var(--ink);
  background: var(--bg);
  transform: rotate(-2deg) translateY(-2px);
}
.gallery-fab-icon { font-size: 16px; }

/* 图鉴打开时隐藏右上角按钮和表情 */
.gallery-overlay.open ~ .symbols,
.gallery-overlay.open ~ .fullscreen-btn,
.gallery-overlay.open ~ .contact-system,
.gallery-overlay.open ~ .contact-bubble,
.gallery-overlay.open ~ .contact-btn,
.gallery-overlay.open ~ .menu-btn,
.gallery-overlay.open ~ .gallery-fab,
.gallery-overlay.open ~ .tap-guide,
body:has(.gallery-overlay.open) .symbols,
body:has(.gallery-overlay.open) .fullscreen-btn,
body:has(.gallery-overlay.open) .contact-system,
body:has(.gallery-overlay.open) .contact-bubble,
body:has(.gallery-overlay.open) .contact-btn,
body:has(.gallery-overlay.open) .menu-btn,
body:has(.gallery-overlay.open) .gallery-fab,
body:has(.gallery-overlay.open) .tap-guide { display: none !important; }

/* 移动端：图鉴工具栏降低 backdrop-filter 性能开销 */
@media (max-width: 1024px) {
  .gallery-toolbar {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
}

@media (max-width: 768px) {
  .gallery-title { font-size: 15px; letter-spacing: 1px; }
  .gallery-filter-btn { font-size: 12px; padding: 4px 10px; }
  .gallery-toolbar { gap: 8px; padding: 10px 12px; }
  .gallery-zoom-controls { right: 12px; bottom: 16px; }
  .gallery-zoom-controls button { width: 36px; height: 36px; font-size: 18px; }
  .gallery-zoom-reset { font-size: 12px !important; width: 40px !important; }
  .gallery-detail-content { padding: 18px; }
  .gallery-detail-art { width: 140px; }
  .gallery-hint { font-size: 11px; padding: 5px 10px; bottom: 10px; }
}

/* ========================================
   文游模式 — 沉浸式叙事
   ======================================== */
.adventure-page {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  transition: background 1.5s ease;
  padding: 0;
  margin: 0;
}
.adventure-page.active { display: flex; }
.app.phase-adventure .adventure-page { display: flex; }
/* 文游模式下取消 .app 的 transform 和 will-change，让 fixed 定位相对于视口 */
.app.phase-adventure {
  transform: none !important;
  will-change: auto !important;
}
.app.phase-adventure .gate-page,
.app.phase-adventure .hero,
.app.phase-adventure .select-page,
.app.phase-adventure .result-page,
.app.phase-adventure .combo-page,
.app.phase-adventure .planet-system,
.app.phase-adventure .symbols,
.app.phase-adventure .tap-guide,
.app.phase-adventure .start-hit,
.app.phase-adventure .contact-btn,
.app.phase-adventure .lang-switch,
.app.phase-adventure .more-modes { display: none !important; }

/* 文游模式下隐藏背景切换按钮 */
body.phase-adventure .bg-switch-btn { display: none !important; }

.adventure-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  transition: opacity 1s ease;
}
.adv-ch1 .adventure-bg { background: linear-gradient(180deg,#e8e0d4 0%,#d8cfc0 100%); }
.adv-ch2 .adventure-bg { background: linear-gradient(180deg,#d4c4b0 0%,#c0a890 100%); }
.adv-ch3 .adventure-bg { background: linear-gradient(180deg,#3a3028 0%,#2a2218 100%); }
.adv-ch4 .adventure-bg { background: linear-gradient(180deg,#2a2018 0%,#3a2818 100%); }
.adv-ch5 .adventure-bg { background: linear-gradient(180deg,#1a1208 0%,#2a1810 100%); }
.adv-ch6 .adventure-bg { background: linear-gradient(180deg,#d8c8b8 0%,#c8b8a0 100%); }
.adv-ch7 .adventure-bg { background: linear-gradient(180deg,#f0e8d8 0%,#e0d0b8 100%); }
.adv-ch8 .adventure-bg { background: linear-gradient(180deg,#2a1a28 0%,#1a0e18 100%); }
.adv-ch9 .adventure-bg { background: linear-gradient(180deg,#0a0508 0%,#15080a 100%); }
.adv-ch10 .adventure-bg { background: linear-gradient(180deg,#f5edd0 0%,#e0c898 100%); }
.adv-ch11 .adventure-bg { background: linear-gradient(180deg,#e0d0c0 0%,#c8b098 100%); }
.adv-ch12 .adventure-bg { background: linear-gradient(180deg,#f8f3ea 0%,#e8dcc8 100%); }

.adv-ch3 .adventure-content, .adv-ch4 .adventure-content, .adv-ch5 .adventure-content,
.adv-ch8 .adventure-content, .adv-ch9 .adventure-content { color: #f0e8d8; }
.adv-ch3 .adventure-chapter-tag, .adv-ch4 .adventure-chapter-tag, .adv-ch5 .adventure-chapter-tag,
.adv-ch8 .adventure-chapter-tag, .adv-ch9 .adventure-chapter-tag { color: #8a7a60; }
.adv-ch3 .adventure-stats, .adv-ch4 .adventure-stats, .adv-ch5 .adventure-stats,
.adv-ch8 .adventure-stats, .adv-ch9 .adventure-stats { color: #9a8a70; }
.adv-ch3 .adventure-stat-bar, .adv-ch4 .adventure-stat-bar, .adv-ch5 .adventure-stat-bar,
.adv-ch8 .adventure-stat-bar, .adv-ch9 .adventure-stat-bar { background: rgba(255,255,255,.1); }
.adv-ch3 .adventure-cursor, .adv-ch4 .adventure-cursor, .adv-ch5 .adventure-cursor,
.adv-ch8 .adventure-cursor, .adv-ch9 .adventure-cursor { background: #c0a060; }
.adv-ch3 .adv-choice-btn:hover, .adv-ch4 .adv-choice-btn:hover, .adv-ch5 .adv-choice-btn:hover,
.adv-ch8 .adv-choice-btn:hover, .adv-ch9 .adv-choice-btn:hover { color: #e0b060; }
.adv-ch3 .adv-choice-hint, .adv-ch4 .adv-choice-hint, .adv-ch5 .adv-choice-hint,
.adv-ch8 .adv-choice-hint, .adv-ch9 .adv-choice-hint { color: #7a6a50; }
.adv-ch3 .adventure-event-result, .adv-ch4 .adventure-event-result, .adv-ch5 .adventure-event-result,
.adv-ch8 .adventure-event-result, .adv-ch9 .adventure-event-result { background: rgba(255,255,255,.05); border-left-color: #c0a060; }

.adventure-deco {
  position: absolute;
  font-size: 120px;
  opacity: .05;
  font-weight: 900;
  z-index: 1;
  pointer-events: none;
  user-select: none;
  font-family: "Noto Serif SC", serif;
}
.adventure-deco-1 { top: 15%; right: 8%; }
.adventure-deco-2 { bottom: 10%; left: 5%; }

.adventure-chapter-tag {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  letter-spacing: 8px;
  color: #888;
  z-index: 10;
  font-family: "Noto Serif SC", serif;
  opacity: 0;
  transition: opacity .8s ease;
}
.adventure-chapter-tag.show { opacity: 1; }

.adventure-stats {
  position: absolute;
  top: 72px;
  right: 32px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
  font-size: 13px;
  color: #888;
  opacity: 0;
  transition: opacity .6s ease;
}
.adventure-stats.show { opacity: 1; }
.adventure-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.adventure-stat-bar {
  width: 60px;
  height: 4px;
  background: rgba(0,0,0,.1);
  border-radius: 2px;
  overflow: hidden;
}
.adventure-stat-fill {
  height: 100%;
  background: #c0392b;
  border-radius: 2px;
  transition: width .8s ease;
  width: 0%;
}
.adventure-stat-label { width: 28px; text-align: right; }

.adventure-content {
  max-width: 600px;
  width: 90%;
  padding: 0 20px;
  margin: auto;
  position: relative;
  z-index: 5;
}
.adventure-text {
  font-size: 21px;
  line-height: 2;
  letter-spacing: 1px;
  min-height: 100px;
  margin-bottom: 36px;
  font-family: "Noto Serif SC", "STSong", serif;
}
.adventure-cursor {
  display: inline-block;
  width: 2px;
  height: 21px;
  background: #c0392b;
  animation: adv-blink .8s infinite;
  vertical-align: middle;
  margin-left: 2px;
}
@keyframes adv-blink { 0%,50%{opacity:1} 51%,100%{opacity:0} }

.adventure-choices {
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .6s ease, transform .6s ease;
  max-height: none;
  overflow: visible;
  padding-right: 0;
  margin-right: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(192,57,43,.3) transparent;
}
.adventure-choices.show { opacity: 1; transform: translateY(0); }
.adventure-choices::-webkit-scrollbar { width: 4px; }
.adventure-choices::-webkit-scrollbar-track { background: transparent; }
.adventure-choices::-webkit-scrollbar-thumb { background: rgba(192,57,43,.25); border-radius: 4px; }
.adventure-choices::-webkit-scrollbar-thumb:hover { background: rgba(192,57,43,.5); }
.adv-ch3 .adventure-choices::-webkit-scrollbar-thumb,
.adv-ch4 .adventure-choices::-webkit-scrollbar-thumb,
.adv-ch5 .adventure-choices::-webkit-scrollbar-thumb,
.adv-ch8 .adventure-choices::-webkit-scrollbar-thumb,
.adv-ch9 .adventure-choices::-webkit-scrollbar-thumb { background: rgba(224,176,96,.25); }
.adv-ch3 .adventure-choices::-webkit-scrollbar-thumb:hover,
.adv-ch4 .adventure-choices::-webkit-scrollbar-thumb:hover,
.adv-ch5 .adventure-choices::-webkit-scrollbar-thumb:hover,
.adv-ch8 .adventure-choices::-webkit-scrollbar-thumb:hover,
.adv-ch9 .adventure-choices::-webkit-scrollbar-thumb:hover { background: rgba(224,176,96,.5); }
.adv-choice-btn {
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 18px;
  line-height: 1.7;
  color: inherit;
  padding: 10px 0;
  position: relative;
  transition: padding-left .4s ease, color .3s ease;
  letter-spacing: .5px;
}
.adv-choice-btn::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 6px;
  width: 0;
  height: 1px;
  background: #c0392b;
  transition: width .4s ease;
}
.adv-choice-btn:hover { padding-left: 20px; color: #c0392b; }
.adv-choice-btn:hover::before { width: 100%; }
.adv-choice-hint {
  font-size: 13px;
  color: #888;
  margin-top: 4px;
  display: block;
  letter-spacing: 1px;
}

.adventure-event-result {
  font-size: 18px;
  line-height: 2;
  padding: 12px 20px;
  margin-bottom: 20px;
  border-left: 3px solid #c0392b;
  background: rgba(0,0,0,.03);
  opacity: 0;
  transition: opacity .6s ease;
}
.adv-ch3 .adventure-event-result, .adv-ch4 .adventure-event-result, .adv-ch5 .adventure-event-result {
  background: rgba(255,255,255,.05);
  border-left-color: #c0a060;
}
.adventure-event-result.show { opacity: 1; }
.adventure-event-result.success { border-left-color: #27ae60; }
.adventure-event-result.fail { border-left-color: #e74c3c; }

.adventure-ending { display: none; text-align: center; padding: 40px 0; }
.adventure-ending.show { display: block; }
.adv-ending-label { font-size: 14px; color: #888; letter-spacing: 6px; margin-bottom: 16px; }
.adv-ending-dish { font-size: 36px; font-weight: 900; letter-spacing: 4px; margin-bottom: 24px; font-family: "Noto Serif SC", serif; }
.adv-ending-story { font-size: 17px; line-height: 2; color: #888; max-width: 480px; margin: 0 auto 32px; }
.adv-ending-attrs { display: flex; justify-content: center; gap: 24px; margin-bottom: 24px; font-size: 14px; color: #c0392b; }
.adv-ending-path { font-size: 13px; color: #888; margin-bottom: 32px; line-height: 1.8; }
.adv-restart-btn {
  background: none;
  border: 1px solid #888;
  color: #888;
  padding: 10px 32px;
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all .4s ease;
}
.adv-restart-btn:hover { border-color: #1a1a1a; color: #1a1a1a; }

.adv-ending-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 28px;
}
.adv-home-btn {
  background: none;
  border: 1px solid #888;
  color: #888;
  padding: 10px 32px;
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all .4s ease;
}
.adv-home-btn:hover { border-color: #1a1a1a; color: #1a1a1a; }

/* ===== 文游模式：退出按钮（左上角，避开右上角菜单） ===== */
.adv-exit-btn {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 900;
  background: rgba(255,255,255,.86);
  border: 1px solid #ccc;
  color: #888;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: all .3s ease;
}
.adv-exit-btn:hover {
  background: #fff;
  color: #333;
  border-color: #999;
}
.adv-ch3 .adv-exit-btn, .adv-ch4 .adv-exit-btn, .adv-ch5 .adv-exit-btn,
.adv-ch8 .adv-exit-btn, .adv-ch9 .adv-exit-btn {
  background: rgba(30,20,15,.7);
  color: #a09080;
  border-color: #4a3a2a;
}
.adv-ch3 .adv-exit-btn:hover, .adv-ch4 .adv-exit-btn:hover, .adv-ch5 .adv-exit-btn:hover,
.adv-ch8 .adv-exit-btn:hover, .adv-ch9 .adv-exit-btn:hover {
  background: rgba(60,40,30,.8);
  color: #f0e8d8;
}

/* ===== 文游模式：返回上一步按钮 ===== */
.adv-back-btn {
  position: fixed;
  left: 24px;
  bottom: 84px;
  z-index: 900;
  color: var(--muted);
  padding: 10px 22px 11px;
  border: 2px solid currentColor;
  border-radius: 42% 58% 46% 54% / 58% 47% 53% 42%;
  background: rgba(255,255,255,.86);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease, color .3s ease, transform .3s var(--ease), background .3s ease;
}
.adv-back-btn.show {
  opacity: 1;
  pointer-events: auto;
}
.adv-back-btn:hover {
  color: var(--ink);
  background: var(--bg);
  transform: rotate(2deg) translateY(-2px);
}
/* 暗色章节中返回按钮文字变亮 */
.adv-ch3 .adv-back-btn, .adv-ch4 .adv-back-btn, .adv-ch5 .adv-back-btn,
.adv-ch8 .adv-back-btn, .adv-ch9 .adv-back-btn {
  color: #a09080;
  background: rgba(30,20,15,.7);
}
.adv-ch3 .adv-back-btn:hover, .adv-ch4 .adv-back-btn:hover, .adv-ch5 .adv-back-btn:hover,
.adv-ch8 .adv-back-btn:hover, .adv-ch9 .adv-back-btn:hover {
  color: #f0e8d8;
  background: rgba(60,40,30,.8);
}

/* ===== 文游模式：场景名显示 ===== */
.adventure-scene-name {
  position: absolute;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  font-size: 14px;
  letter-spacing: 4px;
  color: #999;
  opacity: 0;
  transition: opacity 1.2s ease;
  white-space: nowrap;
  font-family: "Noto Serif SC", serif;
}
.adventure-scene-name.show { opacity: .7; }
.adv-ch3 .adventure-scene-name, .adv-ch4 .adventure-scene-name, .adv-ch5 .adventure-scene-name,
.adv-ch8 .adventure-scene-name, .adv-ch9 .adventure-scene-name { color: #7a6a55; }

.adventure-btn { border-color: #b8956a; color: #8b7355; }
.adventure-btn:hover { background: #b8956a; color: #fff; }

@media (max-width: 600px) {
  .adventure-text { font-size: 16px; line-height: 1.8; }
  .adv-choice-btn { font-size: 16px; }
  .adventure-stats { right: 16px; top: 56px; }
  .adventure-chapter-tag { top: 16px; }
  .adv-ending-dish { font-size: 28px; }
  .adv-back-btn { left: 12px; bottom: 60px; font-size: 15px; padding: 7px 16px 8px; }
  .adventure-scene-name { top: 44px; font-size: 12px; letter-spacing: 3px; }
}

/* ========== 全面移动端增强 ========== */
@media (max-width: 1024px) and (orientation: portrait) {
  /* 触摸目标最小44px */
  .adv-choice-btn { min-height: 48px; padding: 12px 16px; font-size: 16px; }
  .adv-choice-hint { font-size: 13px; }

  /* 文游模式移动端布局 */
  .adventure-page {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    display: none;
    box-sizing: border-box;
  }
  .app.phase-adventure .adventure-page {
    display: flex !important;
    flex-direction: column;
  }
  .adventure-content {
    width: 90% !important;
    max-width: 600px !important;
    margin: auto !important;
    height: auto !important;
    overflow: visible !important;
  }
  .adventure-text {
    font-size: 16px !important;
    line-height: 1.8;
    max-height: none !important;
    overflow: visible !important;
    padding: 12px 0;
  }
  .adventure-event-result {
    font-size: 15px !important;
    line-height: 1.7;
    max-height: none !important;
    overflow: visible !important;
  }
  .adventure-choices {
    width: 100% !important;
    max-width: none !important;
    gap: 10px;
    overflow: visible !important;
    max-height: none !important;
  }
  .adventure-ending {
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    overflow-y: auto !important;
    padding: 20px 12px;
  }
  .adv-ending-dish { font-size: 24px; }
  .adv-ending-story { font-size: 15px; line-height: 1.8; }
  .adv-ending-attrs { font-size: 13px; gap: 8px; flex-wrap: wrap; }
  .adv-ending-path { font-size: 12px; line-height: 1.6; }

  /* 文游退出/返回按钮触摸优化（退出在左，菜单在右，不重叠） */
  .adv-exit-btn { top: 12px; left: 12px; padding: 8px 14px; font-size: 14px; min-height: 36px; }
  .adv-back-btn { left: 12px; bottom: 70px; padding: 10px 18px; font-size: 14px; min-height: 40px; }
  #advRestartBtn, #advHomeBtn { padding: 10px 20px; font-size: 14px; min-height: 44px; }

  /* 图鉴移动端增强 */
  .gallery-overlay {
    position: fixed !important;
    inset: 0 !important;
    overflow-y: auto !important;
  }
  .gallery-canvas-wrap {
    width: 100% !important;
    height: auto !important;
    min-height: 100vh;
  }
  .gallery-detail {
    inset: 0 !important;
    padding: 40px 16px 20px !important;
    overflow-y: auto !important;
  }
  .gallery-detail-content {
    width: 100% !important;
    max-width: 400px;
    max-height: none !important;
    overflow: visible !important;
    padding: 20px 16px !important;
  }
  .gallery-detail-art { width: 140px; }
  .crayon-dish-name { font-size: 22px; }
  .gallery-detail-name { font-size: 18px; }
  .gallery-detail-intro, .gallery-detail-review { font-size: 14px; line-height: 1.7; }
  .gallery-detail-pairs li { font-size: 13px; line-height: 1.6; }
  .gallery-detail-close { top: 12px; right: 12px; width: 36px; height: 36px; font-size: 18px; }

  /* 套餐选择器移动端 */
  .combo-page {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 60px 16px calc(80px + var(--safe-bottom));
    overflow-y: auto !important;
    z-index: 900;
    box-sizing: border-box;
  }
  .combo-roller { width: 100% !important; max-width: 200px; }
  .roller-item { height: 36px; font-size: 18px; }
  .combo-card { width: 100% !important; max-width: 300px; }
  .combo-detail { font-size: 14px; line-height: 1.7; }

  /* 背景切换按钮移动端位置 */
  /* 背景切换按钮移动端位置已在上方统一定义 */

  /* gateExplain 移动端样式 */
  .gate-explain {
    position: fixed !important;
    bottom: calc(150px + var(--safe-bottom)) !important;
    left: 50% !important;
    top: auto !important;
    transform: translateX(-50%) !important;
    width: 86vw !important;
    max-width: 360px;
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 14px;
    z-index: 950;
  }
  .gate-explain.show {
    animation: fadeInUp 0.3s ease;
  }
  @keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
  }
  /* 子菜单展开时隐藏底部文案，避免和按钮重叠 */
  body:has(.more-plays-menu.open) .gate-explain,
  .app:has(.more-plays-menu.open) .gate-explain {
    display: none !important;
  }

  /* "直接看结果"展开菜单移动端 */
  .more-plays-menu {
    position: relative !important;
    width: 100% !important;
    max-width: 340px;
  }
  .more-plays-menu.open {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px 0;
  }
  .more-plays-menu .more-plays-item {
    min-height: 52px;
    font-size: 14px;
    width: 100%;
  }
  /* 最后一个按钮不要拉宽跨两列，居中对齐 */
  .more-plays-menu .more-plays-item:last-of-type {
    grid-column: 1 / -1;
    justify-self: center;
    width: 50%;
  }

  /* 防止文字选择干扰触摸操作 */
  .choice-card, .adv-choice-btn, .start-btn, .roller-item {
    -webkit-user-select: none;
    user-select: none;
  }

  /* 移动端 :active 替代 :hover */
  .start-btn:active { background: var(--ink); color: var(--bg); }
  .adv-choice-btn:active { padding-left: 20px; color: #c0392b; }
  .more-plays-item:active { background: var(--ink); color: var(--bg); }
  .choice-card:active { transform: scale(0.97); }
  .adv-restart-btn:active, .adv-home-btn:active { border-color: #1a1a1a; color: #1a1a1a; }
  .info-bubble:active { background: var(--ink); color: var(--bg); }
  .gallery-filter-btn:active { color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.4); }

  /* 结果页滚动优化 */
  .result-page { overflow-y: auto; }

  /* 翻译弹窗移动端增强 */
  .translate-overlay {
    overflow-y: auto !important;
    padding: 40px 16px !important;
  }
  .translate-modal {
    width: 100% !important;
    max-width: 400px;
    margin: 0 auto;
  }

  /* 联系面板移动端增强 */
  .contact-overlay {
    overflow-y: auto !important;
    padding: 20px 12px !important;
  }
}
