﻿: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);
}

/* 左上角全屏按钮 - 参考"重新开始"手绘风格 */
.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::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;
  margin: 0;
  overflow: hidden;       /* 禁止滚动条，避免滚动条占用空间导致视觉偏移 */
  display: flex;          /* flex 主容器 */
  justify-content: center;/* 水平居中所有主内容 */
  align-items: center;    /* 垂直居中所有主内容 */
  background: var(--bg);
  color: var(--ink);
  font-family: SimHei, "Microsoft YaHei", "PingFang SC", sans-serif;
}

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: var(--bg);
}

/* 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: var(--bg);
  transform-origin: center center; /* 缩放原点设在画布中心，缩放后仍居中 */
  contain: layout style paint;
}

.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;
  gap: 40px;
  margin-top: 40px;
}

.start-btn {
  width: 180px;
  height: 180px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: rgba(255,255,255,.86);
  color: var(--ink);
  font-size: 26px;
  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);
}

/* 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;
}

.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(-16deg);
}

.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); } }
/* 小球滚动质感：仅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: break-word;
}

.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: none;
}

/* 联系弹窗：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;
  left: 34px;
  bottom: 28px;
  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 {
  opacity: 1;
  pointer-events: auto;
}

.restart: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;
}

/* 结果卡片：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: 24px;
  z-index: 900;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 1px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.translate-btn:hover {
  background: var(--line);
  color: var(--bg);
  transform: scale(1.08);
}
.translate-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ========== 翻译弹窗遮罩 ========== */
.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 (max-width: 768px) {
  /* 基础调整 */
  html { font-size: 14px; }
  * { -webkit-tap-highlight-color: transparent; }
  body { overflow-x: hidden; }

  /* 所有按钮去除300ms延迟 */
  button, a, .option, .planet-wrap, #dogHandle,
  #startLifeBtn, #randomPickBtn, #needDrinkBtn, #skipResultBtn {
    touch-action: manipulation;
  }

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

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

  /* 联系按钮和气泡 */
  .contact-btn {
    width: 36px; height: 36px; bottom: 70px; right: 10px; font-size: 16px;
  }
  .contact-bubble {
    bottom: 112px; 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: 10px; 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; }
}
