/* 影子折叠 · Gấp Hình Bóng — 界面样式（竖屏优先，电脑横屏时变宽）。纸艺 + 皮影戏：薰衣草黄昏、暖色灯笼光、奶油色纸卡 */
:root {
  --bg-top: #c3acdd;
  --bg-mid: #9a80bf;
  --bg-bot: #5a4479;
  --ink: #3d2b57;
  --ink-2: #66507f;
  --muted: #9c8bb3;
  --paper: #fbf3e6;
  --paper-2: #f3e3cb;
  --gold: #f0bd63;
  --gold-2: #d58d3b;
  --peach: #f2a27e;
  --coral: #e27a62;
  --violet: #6e4e99;
  --panel: rgba(252, 245, 234, 0.88);
  --panel-2: rgba(246, 233, 214, 0.95);
  --line: rgba(110, 80, 140, 0.24);
  --shadow: 0 14px 34px rgba(58, 34, 88, 0.3);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  color: var(--ink);
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background:
    radial-gradient(ellipse at 8% 4%, rgba(255, 196, 140, 0.55), transparent 50%),
    radial-gradient(ellipse at 92% 26%, rgba(255, 220, 190, 0.25), transparent 45%),
    radial-gradient(ellipse at 50% 112%, rgba(70, 40, 110, 0.5), transparent 60%),
    linear-gradient(170deg, var(--bg-top), var(--bg-mid) 55%, var(--bg-bot));
  background-attachment: fixed;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: 0.42; cursor: default; }
[hidden] { display: none !important; }
svg.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* GPT 背景图（竖屏 / 横屏各一张），上面压一层淡紫色，保证纸幕和文字清晰；没有图时就是上面的渐变 */
.bgArt {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(120, 90, 160, 0.12), rgba(70, 45, 105, 0.32)), url(../assets/art/bg-portrait.jpg) center / cover no-repeat;
}
@media (orientation: landscape) {
  .bgArt { background-image: linear-gradient(180deg, rgba(120, 90, 160, 0.12), rgba(70, 45, 105, 0.32)), url(../assets/art/bg-landscape.jpg); }
}
#fx { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
#app { position: fixed; inset: 0; max-width: 640px; margin: 0 auto; z-index: 2; }
@media (orientation: landscape) and (min-width: 900px) { #app { max-width: 1040px; } }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(10px + var(--safe-t)) 16px calc(10px + var(--safe-b)); }

/* ---------- 按钮（纸卡风格） ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 11px 22px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  font-weight: 800; font-size: 15px; letter-spacing: 0.2px;
  box-shadow: 0 6px 16px rgba(58, 34, 88, 0.2), inset 0 -3px 0 rgba(150, 110, 70, 0.14);
}
.btn.primary {
  border: 0; color: #4a2410;
  background: linear-gradient(180deg, #ffe2a6, var(--gold) 48%, var(--gold-2));
  box-shadow: 0 10px 24px rgba(214, 140, 60, 0.38), inset 0 -3px 0 rgba(150, 80, 20, 0.3);
}
.btn.ghost { background: rgba(252, 245, 234, 0.42); box-shadow: none; }
a.btn { text-decoration: none; }
.btn.lg { min-height: 54px; font-size: 17px; border-radius: 16px; }
.btn:focus-visible, .iconBtn:focus-visible, .tool:focus-visible, .lvCard:focus-visible, .langSwitch button:focus-visible { outline: 3px solid #fff3c4; outline-offset: 2px; }
.iconBtn {
  width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  box-shadow: 0 4px 12px rgba(58, 34, 88, 0.18);
}
.iconSpacer { width: 44px; flex: none; }
[data-act="sound"] .ico.off, [data-act="sound"].off .ico.on, [data-act="music"] .ico.off, [data-act="music"].off .ico.on { display: none; }
[data-act="sound"].off .ico.off, [data-act="music"].off .ico.off { display: block; }
.topBtns { display: flex; gap: 8px; }

/* ---------- 首页 ---------- */
.homeScreen { align-items: center; justify-content: space-between; text-align: center; }
.homeTop { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.homeTop .topBtns { margin-left: auto; }
.langSwitch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.langSwitch button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--ink-2); min-height: 44px; }
.langSwitch button[aria-pressed="true"] { background: var(--violet); color: #fff6e6; }
.homeHero { position: relative; display: flex; flex-direction: column; align-items: center; }
.logoWrap {
  width: min(46vw, 196px); aspect-ratio: 1; border-radius: 26%; overflow: hidden;
  box-shadow: 0 0 0 3px rgba(255, 238, 205, 0.85), 0 0 60px rgba(255, 190, 120, 0.55), var(--shadow);
  animation: float 4.5s ease-in-out infinite, logoGlow 3.4s ease-in-out infinite;
}
.logoWrap img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.015); }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes logoGlow { 50% { box-shadow: 0 0 0 3px rgba(255, 238, 205, 1), 0 0 86px rgba(255, 200, 130, 0.8), 0 14px 34px rgba(58, 34, 88, 0.3); } }
.heroCrane { position: absolute; right: calc(50% - min(46vw, 196px) / 2 - 58px); top: -6px; width: 84px; height: 84px; object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(58, 34, 88, 0.35)); animation: craneFly 6s ease-in-out infinite; pointer-events: none; }
@keyframes craneFly { 0%, 100% { transform: translate(0, 0) rotate(-6deg); } 50% { transform: translate(-8px, -12px) rotate(4deg); } }
.homeHero h1 {
  margin: 24px 0 2px; font-size: clamp(34px, 10vw, 50px); font-weight: 900; letter-spacing: -0.5px; line-height: 1.12;
  background: linear-gradient(180deg, #fffaf0, #ffe1a0 62%, #f0a94d); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(90, 55, 130, 0.55)) drop-shadow(0 6px 16px rgba(60, 30, 90, 0.4));
}
.subtitle { margin: 12px 0 0; color: #fff8ec; font-size: 14.5px; font-weight: 700; text-shadow: 0 2px 8px rgba(60, 30, 90, 0.55);
  padding: 7px 16px; border-radius: 999px; background: rgba(90, 60, 130, 0.42); }
.homeActions { width: min(340px, 100%); display: flex; flex-direction: column; gap: 12px; }
.homeProgress { margin: 4px 0 0; color: #fff3d6; font-weight: 800; font-size: 14px; min-height: 20px; text-shadow: 0 2px 6px rgba(60, 30, 90, 0.6); }

/* ---------- 顶栏 ---------- */
.hud { display: flex; align-items: center; gap: 10px; }
.hudTitle { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; color: #fffaf0; text-shadow: 0 2px 8px rgba(50, 25, 80, 0.6); }
.hudTitle small { color: #ffe4a8; font-weight: 800; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; }
.hudTitle strong { font-size: 19px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.levelsScreen .hudTitle small { text-transform: none; letter-spacing: 0; }

/* ---------- 选关 ---------- */
.levelGrid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px 2px 8px; align-content: start; }
.lvCard {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  min-height: 132px; padding: 12px 14px; border-radius: 16px; border: 1px solid rgba(160, 120, 80, 0.3);
  background: linear-gradient(165deg, #fdf6ea, #f2e1c6); box-shadow: var(--shadow); color: var(--ink);
}
.lvCard::before { content: ""; position: absolute; inset: 6px; border: 1px dashed rgba(120, 90, 150, 0.25); border-radius: 11px; pointer-events: none; }
.lvCard.done { border-color: rgba(214, 141, 59, 0.6); }
.lvNum { font-size: 26px; font-weight: 900; color: var(--coral); line-height: 1; position: relative; z-index: 1; }
.lvName { font-weight: 800; font-size: 14.5px; line-height: 1.3; position: relative; z-index: 1; }
.lvStars { display: flex; gap: 2px; margin-top: auto; position: relative; z-index: 1; }
.lvArt { position: absolute; right: 8px; bottom: 8px; width: 52%; height: 60%; pointer-events: none; }
.lvName { max-width: 100%; text-shadow: 0 1px 0 rgba(255,250,240,0.9), 0 0 6px rgba(255,248,236,0.95); }
.lvCard.locked { opacity: 0.62; background: linear-gradient(165deg, #e9def0, #d6c7e2); }
.lvCard.locked .lvNum { color: var(--muted); }
svg.lock { position: absolute; right: 12px; top: 12px; width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.star { width: 18px; height: 18px; fill: rgba(110, 80, 140, 0.16); stroke: rgba(110, 80, 140, 0.35); stroke-width: 1; stroke-linejoin: round; }
svg.star.on { fill: var(--gold); stroke: #b4702a; filter: drop-shadow(0 0 5px rgba(255, 190, 90, 0.7)); }

/* ---------- 游戏 ---------- */
.gameScreen { padding-bottom: calc(8px + var(--safe-b)); }
.hudStats { display: flex; justify-content: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); font-weight: 700; }
.pill b { color: var(--ink); font-size: 15px; }
.pill.gold { color: #9a5a1c; border-color: rgba(214, 141, 59, 0.45); background: rgba(255, 238, 200, 0.92); }
.pill.paper svg { width: 14px; height: 14px; fill: var(--peach); stroke: #c0603f; stroke-width: 1.5; stroke-linejoin: round; }
.boardWrap { flex: 1; min-height: 0; display: grid; place-items: center; padding: 6px 0; }
#board { display: block; touch-action: none; cursor: grab; }
/* V004：工具按钮随关卡出现（hidden 的按钮不占位），剩下的按钮平分一行 */
.tools { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.tool {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 58px; border-radius: 15px; border: 1px solid var(--line); background: var(--panel);
  font-size: 11px; font-weight: 800; color: var(--ink-2); box-shadow: 0 5px 14px rgba(58, 34, 88, 0.18); letter-spacing: -0.2px;
}
.tool .ico { width: 23px; height: 23px; color: var(--ink); }
.tool.act { background: linear-gradient(180deg, #fff7ea, #f6e2c4); border-color: rgba(190, 130, 80, 0.38); }
.tool.act .ico { color: #b45a3c; }
.tool[data-act="hint"] .ico { color: #c4862e; }
.tool.lit { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(255, 196, 100, 0.7); }
.tool span { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: clip; padding: 0 1px; }
.tool.pulse { animation: toolPulse 0.9s ease 3; }
@keyframes toolPulse { 50% { background: rgba(255, 214, 140, 0.95); border-color: var(--gold-2); transform: scale(1.06); } }

/* ---------- 弹层 ---------- */
.overlay { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(50, 28, 80, 0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.tipCard, .winCard, .pauseCard, .finaleCard {
  position: relative; width: min(420px, 100%); border-radius: 22px; padding: 22px; text-align: center; color: var(--ink);
  background: linear-gradient(172deg, #fffaf1, #f5e6cf);
  border: 1px solid rgba(214, 160, 100, 0.55); box-shadow: var(--shadow), 0 0 50px rgba(255, 200, 140, 0.35);
  animation: pop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.tipCard::before, .winCard::before, .pauseCard::before, .finaleCard::before { content: ""; position: absolute; inset: 7px; border: 1px dashed rgba(120, 90, 150, 0.3); border-radius: 16px; pointer-events: none; }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } }
.robot { width: 96px; height: 96px; margin: -52px auto 0; display: block; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(58, 34, 88, 0.4)); animation: float 3s ease-in-out infinite; }
.tipCard, .winCard { margin-top: 34px; }
.tipBody small, .winCard small { color: var(--coral); font-weight: 800; font-size: 12px; letter-spacing: 1px; }
.tipBody h2, .winCard h2, .pauseCard h2, .finaleCard h2 { margin: 4px 0 8px; font-size: 21px; font-weight: 900; color: var(--violet); }
.tipBody p, .winCard p, .finaleCard p { margin: 0 0 12px; color: var(--ink-2); line-height: 1.6; font-size: 15px; white-space: pre-line; }
.tipDemo { display: block; width: 240px; height: 96px; margin: 0 auto 14px; border-radius: 12px; background: #f6ead6; box-shadow: inset 0 0 0 1px rgba(150, 110, 80, 0.25); }
.tipCard .btn { min-width: 160px; }
.pauseRules { margin: 0 0 14px; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.pauseBtns { display: flex; flex-direction: column; gap: 10px; }
.pauseToggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.toggle { white-space: nowrap; padding: 11px 10px; }
.btn.toggle.off { opacity: 0.6; }
.winOverlay, .finaleOverlay { position: fixed; }
.winShadowBox { width: min(220px, 60vw); aspect-ratio: 4 / 3; margin: 6px auto 2px; border-radius: 14px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, #fff7e6, #f1dcbc 70%, #e2c39b); box-shadow: 0 0 0 2px rgba(214, 160, 100, 0.6), inset 0 0 26px rgba(150, 100, 60, 0.35);
  animation: pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.winShadowBox canvas { width: 100%; height: 100%; display: block; }
.winStars { display: flex; justify-content: center; gap: 10px; margin: 8px 0 2px; }
.winStars svg.star { width: 50px; height: 50px; }
.winStars svg.star:nth-child(2) { transform: translateY(-10px); }
.winStars svg.star.pop { animation: starPop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.5); }
.winStars svg.star:nth-child(2).pop { animation-name: starPop2; }
@keyframes starPop { from { transform: scale(0.2) rotate(-40deg); } }
@keyframes starPop2 { from { transform: translateY(-10px) scale(0.2) rotate(-40deg); } }
.winBtns { display: flex; flex-direction: column; gap: 10px; }
.finaleCard { width: min(560px, 100%); }
#finaleStage { width: 100%; height: auto; aspect-ratio: 640 / 300; display: block; border-radius: 14px; margin-bottom: 10px; box-shadow: inset 0 0 0 1px rgba(150, 110, 80, 0.3); }

/* ---------- 提示条 ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); z-index: 40; transform: translate(-50%, 20px);
  width: max-content; max-width: min(92vw, 460px); padding: 11px 18px; border-radius: 14px;
  background: rgba(60, 38, 92, 0.95); border: 1px solid rgba(255, 220, 160, 0.45); color: #fff8ec;
  font-size: 14px; line-height: 1.5; text-align: center; white-space: pre-line;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* V004：游戏里提示条放在顶栏（关卡名 + 小牌）下面，不再盖住托盘里的纸片 */
/* V005：竖屏时 top 由 main.js 按顶栏实际下沿设置；这里的 100px 只是取不到时的后备 */
.toast.top { top: calc(100px + var(--safe-t)); bottom: auto; transform: translate(-50%, -14px); }
.toast.top.show { transform: translate(-50%, 0); }

/* ---------- 尺寸适配 ---------- */
@media (min-width: 560px) { .levelGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (orientation: landscape) and (min-width: 900px) { .levelGrid { grid-template-columns: repeat(5, minmax(0, 1fr)); } .tools { max-width: 720px; margin: 0 auto; width: 100%; } }
@media (max-height: 680px) {
  .homeHero h1 { margin-top: 12px; }
  .logoWrap { width: min(36vw, 136px); }
  .tool { min-height: 50px; }
  .tool span { font-size: 10.5px; }
  .hudStats { margin-top: 4px; }
  .pill { padding: 4px 10px; }
  .winShadowBox { width: min(150px, 44vw); }
}
@media (max-width: 420px) { .tool span { font-size: 10.2px; letter-spacing: -0.3px; } .tools { gap: 4px; } }
@media (max-width: 380px) { .tool span { font-size: 9.6px; letter-spacing: -0.4px; } }
/* V005：窄屏（≤420px）6 个工具按钮时「Đẩy xuống」「Hoàn tác」会被截掉 → 文字允许折成两行（按钮高度够放图标 + 两行字） */
@media (max-width: 420px) { .tool span { white-space: normal; line-height: 1.05; text-align: center; } }
/* V005：电脑横屏时纸幕在左、目标卡片和托盘在右 → 提示条放到右栏顶上，不盖住纸幕第一行（提示的金框可能就在那里） */
@media (orientation: landscape) and (min-width: 900px) {
  .toast.top { left: auto; right: 24px; max-width: min(340px, 30vw); transform: translate(0, -14px); }
  .toast.top.show { transform: translate(0, 0); }
}

/* ---------- 动效：按钮悬停与点击 / 画面切换 ---------- */
.btn, .iconBtn, .tool, .lvCard, .langSwitch button { position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s, background-color 0.2s, border-color 0.2s, filter 0.2s, opacity 0.2s; }
@media (hover: hover) {
  .btn:hover:not(:disabled), .iconBtn:hover, .tool:hover:not(:disabled), .lvCard:hover:not(.locked), .langSwitch button:hover {
    transform: translateY(-2px);
    border-color: rgba(214, 141, 59, 0.7);
    box-shadow: 0 10px 24px rgba(58, 34, 88, 0.3), 0 0 18px rgba(255, 196, 120, 0.55);
  }
  .btn.primary:hover { box-shadow: 0 12px 30px rgba(214, 140, 60, 0.45), 0 0 24px rgba(255, 210, 130, 0.6); }
  .btn::after, .iconBtn::after, .tool::after, .lvCard::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(110deg, transparent 32%, rgba(255, 255, 255, 0.55) 50%, transparent 68%);
    transform: translateX(-130%);
  }
  .btn:hover:not(:disabled)::after, .iconBtn:hover::after, .tool:hover:not(:disabled)::after, .lvCard:hover:not(.locked)::after { animation: sheen 0.75s ease; }
  .tool:hover:not(:disabled) .ico { animation: icoBounce 0.5s ease; }
}
@keyframes sheen { to { transform: translateX(130%); } }
@keyframes icoBounce { 40% { transform: translateY(-3px) scale(1.12); } }
.btn:active:not(:disabled), .iconBtn:active, .tool:active:not(:disabled), .lvCard:active:not(.locked), .langSwitch button:active { transform: scale(0.94); transition-duration: 0.08s; }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; transform: scale(0); z-index: 0;
  background: radial-gradient(circle, rgba(255, 236, 200, 0.75), rgba(240, 170, 110, 0.3) 45%, rgba(240, 170, 110, 0) 70%); animation: ripple 0.6s ease-out forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.screen:not([hidden]) { animation: screenIn 0.38s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } }
.lvCard { animation: cardIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) rotate(-2deg) scale(0.92); } }
.pill b.bump { display: inline-block; animation: bump 0.35s ease; }
@keyframes bump { 40% { transform: scale(1.45); color: var(--coral); } }
.homeActions .btn { animation: cardIn 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
.homeActions .btn:nth-child(2) { animation-delay: 0.08s; }
.homeActions .btn:nth-child(3) { animation-delay: 0.16s; }

/* ===================== 加载页：灯笼渐亮 + 狐狸影子浮现 + 纸条逐节展开 ===================== */
body.booting #app { display: none; }
body.booting #fx, body.booting .bgArt { visibility: hidden; }
.boot { --p: 0; position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px 20px calc(24px + var(--safe-b)); overflow: hidden;
  background: radial-gradient(ellipse at 50% 34%, rgba(255, 200, 130, calc(0.15 + var(--p) * 0.45)), transparent 58%),
    linear-gradient(175deg, #6e5596, #4a3668 58%, #2e2046);
  transition: opacity 0.6s ease, transform 0.6s ease; }
.boot.leave { opacity: 0; transform: scale(1.04); pointer-events: none; }
.bootRays { position: absolute; inset: -20%; pointer-events: none; opacity: calc(0.25 + var(--p) * 0.5);
  background: repeating-conic-gradient(from 200deg at 50% 26%, rgba(255, 220, 160, 0.10) 0deg 6deg, transparent 6deg 18deg);
  -webkit-mask-image: radial-gradient(circle at 50% 26%, #000 0, transparent 60%); mask-image: radial-gradient(circle at 50% 26%, #000 0, transparent 60%);
  animation: raysTurn 40s linear infinite; }
@keyframes raysTurn { to { transform: rotate(360deg); } }
.bootInner { position: relative; width: min(360px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; }
.bootStage { position: relative; width: 240px; height: 210px; margin-bottom: 8px; }
.bootWall { position: absolute; left: 10px; right: 10px; top: 36px; bottom: 0; border-radius: 18px;
  background: radial-gradient(ellipse at 50% 18%, rgba(255, 238, 205, calc(0.25 + var(--p) * 0.7)), rgba(236, 210, 175, calc(0.12 + var(--p) * 0.35)) 60%, rgba(200, 170, 140, 0.08));
  box-shadow: inset 0 0 0 2px rgba(255, 230, 190, 0.18); }
/* 墙上的狐狸影子：随加载进度越来越清晰 */
.bootShadow { position: absolute; left: 50%; bottom: 10px; width: 120px; height: 120px; margin-left: -50px;
  background: rgba(58, 36, 86, calc(0.1 + var(--p) * 0.8)); filter: blur(calc((1 - var(--p)) * 5px));
  clip-path: polygon(14% 100%, 18% 62%, 30% 44%, 28% 18%, 38% 32%, 48% 30%, 56% 14%, 58% 36%, 66% 46%, 62% 58%, 80% 64%, 96% 52%, 92% 76%, 80% 92%, 60% 100%);
  transform-origin: 50% 100%; animation: shadowSway 3.2s ease-in-out infinite; }
@keyframes shadowSway { 50% { transform: skewX(-3deg) scaleY(1.02); } }
.bootString { position: absolute; left: 50%; top: 0; width: 2px; height: 26px; margin-left: -1px; background: rgba(255, 230, 190, 0.6); }
.bootLantern { position: absolute; left: 50%; top: 22px; width: 64px; height: 70px; margin-left: -32px; border-radius: 48% / 46%;
  background: repeating-linear-gradient(90deg, rgba(120, 20, 10, 0.16) 0 2px, transparent 2px 11px),
    radial-gradient(ellipse at 50% 46%, rgba(255, 236, 160, calc(0.3 + var(--p) * 0.7)), #f06a3e 52%, #b8362a);
  box-shadow: 0 0 calc(10px + var(--p) * 60px) rgba(255, 170, 80, calc(0.3 + var(--p) * 0.6));
  transform-origin: 50% -22px; animation: lanternSwing 3.6s ease-in-out infinite; }
.bootLantern::before, .bootLantern::after { content: ""; position: absolute; left: 50%; width: 34px; height: 7px; margin-left: -17px; border-radius: 3px; background: linear-gradient(180deg, #ffd27a, #c4882c); }
.bootLantern::before { top: -4px; }
.bootLantern::after { bottom: -4px; }
.bootLantern i { position: absolute; left: 50%; top: 50%; width: 12px; height: 18px; margin: -9px 0 0 -6px; border-radius: 50% 50% 45% 45%;
  background: radial-gradient(circle at 50% 70%, #fffbe6, #ffd36b 55%, rgba(255, 160, 60, 0)); opacity: calc(0.35 + var(--p) * 0.65); animation: flame 0.45s ease-in-out infinite alternate; }
.bootLantern b { position: absolute; left: 50%; bottom: -24px; width: 4px; height: 20px; margin-left: -2px; border-radius: 2px; background: linear-gradient(180deg, #ffcf6e, #d88a2e); }
@keyframes lanternSwing { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes flame { from { transform: scale(0.9, 1) translateY(1px); } to { transform: scale(1.08, 1.12) translateY(-1px); } }
.bootGuide { position: absolute; right: -6px; bottom: -6px; width: 92px; height: 92px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(30, 15, 50, 0.5)); animation: float 3.2s ease-in-out infinite; }
.bootTitle { font-size: clamp(28px, 8.5vw, 38px); font-weight: 900; letter-spacing: 0.3px; margin: 10px 0 14px;
  background: linear-gradient(180deg, #fffaf0, #ffe1a0 60%, #f0a94d); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(60, 30, 90, 0.6)); }
/* 进度条：一条折成 5 节的纸条，加载到哪里就展开到哪里 */
.bootStrip { display: flex; width: 100%; height: 22px; margin: 4px 0 12px; perspective: 400px; }
.bootStrip i { flex: 1; transform-origin: 0 50%; transform: rotateY(-86deg); opacity: 0.25;
  background: linear-gradient(180deg, #fff6e4, #f2d8b2); border: 1px solid rgba(160, 110, 70, 0.4);
  transition: transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.3), opacity 0.3s; }
.bootStrip i:nth-child(even) { background: linear-gradient(180deg, #ffd9c4, #f1a986); }
.bootStrip i.on { transform: rotateY(0deg); opacity: 1; }
.bootPct { font-weight: 800; font-size: 15px; color: #ffe3a6; font-variant-numeric: tabular-nums; }
.bootTip { margin: 6px 0 18px; min-height: 1.5em; color: #f4e8ff; font-size: 14px; }
.bootGo { min-width: 200px; animation: bootPulse 1.6s ease-in-out infinite; }
.boot.ready .bootPct { opacity: 0.6; }
@keyframes bootPulse { 50% { box-shadow: 0 0 0 4px rgba(255, 210, 130, 0.3), 0 0 34px rgba(255, 190, 100, 0.6); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* V003：调试参数 &still=1（截图时关掉 CSS 动画）。原来由 main.js 注入 <style>，服务器 CSP 不允许 */
html.still *, html.still *::before, html.still *::after { animation: none !important; transition: none !important; }
