/* =========================================================
   灶台之上 — 原创像素风网页小游戏
   视觉风格：木框对话、羊皮纸、暖色像素场景
   ========================================================= */
:root{
  --ink:#2c1a12;
  --ink-2:#46271a;
  --ink-3:#6b432c;
  --wood:#7a4a2d;
  --wood-hi:#c58b55;
  --wood-lo:#3a2015;
  --parchment:#f5e3bd;
  --parchment-2:#e8cb97;
  --cream:#fff3d8;
  --gold:#e9b95c;
  --gold-hi:#ffd98b;
  --red:#a9332f;
  --red-hi:#d95646;
  --jade:#487b67;
  --sky:#5a7f94;
  --shadow:0 24px 60px rgba(0,0,0,.55);
  --ui:clamp(12px,1.15vw,16px);
}
*{box-sizing:border-box}
html,body{width:100%;height:100%;margin:0;overflow:hidden;background:#0d0907}
body{
  color:var(--cream);
  font-family:"Microsoft YaHei","PingFang SC","Noto Sans SC","Hiragino Sans GB",sans-serif;
  -webkit-font-smoothing:antialiased;
  user-select:none;
}
button{font:inherit}
button:focus-visible{outline:2px solid var(--gold-hi);outline-offset:3px}
#app{position:relative;width:100vw;height:100dvh;overflow:hidden;isolation:isolate}

/* ---------- 场景 ---------- */
#scene{position:absolute;inset:-2.5%;z-index:0;animation:scene-breathe 26s ease-in-out infinite alternate}
#scene svg{width:100%;height:100%;display:block;shape-rendering:crispEdges}
#scene.scene-enter{animation:scene-enter .55s ease-out both,scene-breathe 26s ease-in-out .55s infinite alternate}
@keyframes scene-enter{from{opacity:.25;transform:scale(1.025)}to{opacity:1;transform:scale(1)}}
@keyframes scene-breathe{from{transform:scale(1.005)}to{transform:scale(1.03)}}

/* ---------- 环境粒子与暗角 ---------- */
#ambient{position:absolute;inset:0;z-index:2;pointer-events:none;overflow:hidden}
.vignette{
  position:absolute;inset:0;
  background:
    radial-gradient(ellipse at 50% 38%,transparent 32%,rgba(12,7,4,.24) 73%,rgba(7,4,2,.72) 100%),
    linear-gradient(to bottom,rgba(10,5,3,.42),transparent 22%,transparent 58%,rgba(10,5,3,.55));
}
.steam{
  position:absolute;bottom:34%;width:22px;height:160px;border-radius:50%;
  background:radial-gradient(ellipse at 50% 70%,rgba(255,240,208,.3),rgba(255,240,208,0) 67%);
  filter:blur(9px);opacity:0;transform-origin:bottom center;
}
.steam.s1{left:19%;animation:steam-rise 8s ease-in-out 0s infinite}
.steam.s2{left:31%;animation:steam-rise 11s ease-in-out 1.7s infinite;height:210px}
.steam.s3{left:61%;animation:steam-rise 9s ease-in-out 3.1s infinite;height:180px}
.steam.s4{left:73%;animation:steam-rise 12s ease-in-out .8s infinite}
.steam.s5{left:45%;animation:steam-rise 10s ease-in-out 4.4s infinite;height:120px}
.steam.s6{right:13%;animation:steam-rise 7.5s ease-in-out 2.3s infinite;height:150px}
#ambient[data-mode="kitchen"] .steam{opacity:.58}
#ambient[data-mode="banquet"] .steam{opacity:.28}
#ambient[data-mode="market"] .steam{opacity:.35}
#ambient[data-mode="memory"] .steam{opacity:.24}
#ambient[data-mode="dawn"] .steam{opacity:.34}
#ambient[data-mode="title"] .steam{opacity:.3}
@keyframes steam-rise{
  0%{transform:translate3d(0,30px,0) scale(.7) rotate(-3deg);opacity:0}
  22%{opacity:.5}
  60%{transform:translate3d(24px,-60px,0) scale(1.05) rotate(4deg);opacity:.35}
  100%{transform:translate3d(-10px,-160px,0) scale(1.35) rotate(-4deg);opacity:0}
}
.mote{
  position:absolute;width:3px;height:3px;background:#ffe2a3;border-radius:50%;
  box-shadow:0 0 6px rgba(255,220,150,.65);opacity:0;
}
.m1{left:12%;top:30%;animation:mote-float 13s linear 1s infinite}
.m2{left:35%;top:48%;animation:mote-float 17s linear 6s infinite}
.m3{left:63%;top:21%;animation:mote-float 15s linear 3s infinite}
.m4{left:82%;top:40%;animation:mote-float 19s linear 9s infinite}
.m5{left:47%;top:16%;animation:mote-float 12s linear 7s infinite}
.m6{left:74%;top:58%;animation:mote-float 16s linear 2.5s infinite}
@keyframes mote-float{
  0%{transform:translateY(60px);opacity:0}
  20%{opacity:.55}
  80%{opacity:.25}
  100%{transform:translateY(-180px) translateX(40px);opacity:0}
}
.scene-fire{animation:fire-flicker .55s steps(3) infinite alternate;transform-origin:bottom center}
.scene-lantern{animation:lantern-sway 5s ease-in-out infinite alternate;transform-origin:top center}
.scene-lantern.l2{animation-delay:-2s}
.scene-light{animation:light-pulse 2.3s steps(4) infinite alternate}
@keyframes fire-flicker{from{transform:scaleY(.88) scaleX(.96);opacity:.8}to{transform:scaleY(1.1) scaleX(1.03);opacity:1}}
@keyframes lantern-sway{from{transform:rotate(-1.4deg)}to{transform:rotate(1.6deg)}}
@keyframes light-pulse{from{opacity:.32}to{opacity:.62}}

/* ---------- HUD ---------- */
.hidden{display:none !important}
.hud{
  position:absolute;z-index:12;left:0;right:0;top:0;
  display:flex;align-items:flex-start;gap:20px;
  padding:14px clamp(16px,2.2vw,34px) 40px;
  background:linear-gradient(to bottom,rgba(12,7,4,.78),rgba(12,7,4,.36) 54%,transparent);
  pointer-events:none;
}
.hud-left{display:flex;align-items:center;gap:12px;min-width:180px}
.brand-mark{
  width:42px;height:42px;display:grid;place-items:center;flex:none;
  color:#3b2115;font-family:"STKaiti","KaiTi","Songti SC",serif;font-size:23px;font-weight:900;
  background:linear-gradient(145deg,#f0c778,#c68f4b 62%,#93602f);
  border:2px solid #3a2115;border-radius:4px;
  box-shadow:0 3px 0 rgba(0,0,0,.42),inset 0 1px 0 rgba(255,255,255,.55),inset 0 -2px 0 rgba(82,43,17,.4);
  transform:rotate(-2deg);
}
.hud-chapter{display:flex;flex-direction:column;gap:1px;text-shadow:0 2px 3px rgba(0,0,0,.8)}
.hud-chapter span{font-size:10px;letter-spacing:.32em;color:var(--gold);font-weight:700}
.hud-chapter strong{font-family:"STKaiti","KaiTi","Songti SC",serif;font-size:clamp(17px,1.7vw,22px);letter-spacing:.08em;font-weight:700;color:#fff3d9}
.hud-stats{display:flex;align-items:center;gap:8px;margin-left:auto;flex-wrap:wrap;justify-content:flex-end}
.stat{
  display:flex;align-items:center;gap:5px;height:30px;padding:0 8px;
  background:linear-gradient(180deg,rgba(55,31,19,.92),rgba(30,17,11,.9));
  border:1px solid rgba(227,181,103,.38);border-radius:3px;
  box-shadow:inset 0 1px 0 rgba(255,235,190,.12),0 2px 7px rgba(0,0,0,.32);
  backdrop-filter:blur(3px);
}
.stat-icon{
  width:18px;height:18px;display:grid;place-items:center;border-radius:2px;
  font-family:"STKaiti","KaiTi",serif;font-size:12px;font-weight:900;color:#27150d;
}
.stat[data-stat="craft"] .stat-icon{background:#e6b25a}
.stat[data-stat="people"] .stat-icon{background:#d9866d}
.stat[data-stat="spirit"] .stat-icon{background:#78a894}
.stat-name{font-size:11px;letter-spacing:.12em;color:#ead6ae;white-space:nowrap}
.stat-track{width:clamp(40px,4.2vw,68px);height:7px;background:#140c08;border:1px solid #5d3a24;box-shadow:inset 0 1px 2px rgba(0,0,0,.8)}
.stat-track i{display:block;height:100%;width:15%;transition:width .65s cubic-bezier(.2,.8,.2,1);box-shadow:inset 0 1px 0 rgba(255,255,255,.25)}
.stat[data-stat="craft"] .stat-track i{background:linear-gradient(90deg,#a76a2b,#f2c66d)}
.stat[data-stat="people"] .stat-track i{background:linear-gradient(90deg,#a9503e,#ee9b79)}
.stat[data-stat="spirit"] .stat-track i{background:linear-gradient(90deg,#3e6e5c,#8dc5a9)}
.stat b{font-family:"Courier New",monospace;font-size:11px;color:#f5dfb6;min-width:18px;text-align:right}
.stat.bump{animation:stat-bump .5s ease}
@keyframes stat-bump{0%,100%{transform:translateY(0)}38%{transform:translateY(-3px);box-shadow:0 0 12px rgba(233,185,92,.5);border-color:var(--gold)}}
.sound-btn{
  pointer-events:auto;width:30px;height:30px;border-radius:3px;cursor:pointer;
  color:#f4d79e;background:rgba(43,24,15,.88);border:1px solid rgba(227,181,103,.4);
  font-family:"Courier New",monospace;font-size:15px;line-height:1;
}
.sound-btn:hover{background:rgba(85,48,29,.95);color:#fff1c6}
.sound-btn.off{opacity:.45;text-decoration:line-through}
.day-chip{
  flex:none;margin-top:2px;padding:4px 8px;border-radius:2px;font-size:10px;letter-spacing:.13em;
  color:#d7bd8b;background:rgba(23,13,8,.55);border:1px solid rgba(201,152,85,.22);white-space:nowrap;
}
.day-chip b{color:#ffe4a9;font-family:"Courier New",monospace;font-size:12px}

/* 数值变化提示 */
.stat-toast{position:absolute;z-index:26;left:50%;top:72px;transform:translateX(-50%);display:flex;flex-wrap:wrap;justify-content:center;gap:7px;pointer-events:none}
.toast-pill{
  display:flex;align-items:center;gap:6px;padding:5px 12px;border-radius:3px;
  background:rgba(30,17,11,.94);border:1px solid rgba(233,185,92,.55);color:#ffe9b7;
  font-size:12px;letter-spacing:.08em;box-shadow:0 6px 18px rgba(0,0,0,.35);
  animation:toast-in 2.4s ease forwards;
}
.toast-pill b{font-family:"Courier New",monospace;color:var(--gold-hi);font-size:14px}
.toast-pill.down b{color:#f08b77}
@keyframes toast-in{0%{opacity:0;transform:translateY(8px)}12%,76%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-10px)}}

/* ---------- 章节卡 ---------- */
.chapter-card{
  position:absolute;z-index:31;left:50%;top:17%;width:min(560px,84vw);padding:24px 34px 21px;
  transform:translate(-50%,-10px);text-align:center;pointer-events:none;opacity:0;
  color:#f8e7c1;background:
    linear-gradient(90deg,rgba(22,12,8,.94),rgba(45,25,15,.92) 50%,rgba(22,12,8,.94));
  border-top:1px solid rgba(234,186,102,.42);border-bottom:1px solid rgba(234,186,102,.42);
  box-shadow:0 20px 55px rgba(0,0,0,.45);
}
.chapter-card::before,.chapter-card::after{
  content:"";position:absolute;left:50%;width:34%;height:1px;background:linear-gradient(90deg,transparent,var(--gold),transparent);transform:translateX(-50%);
}
.chapter-card::before{top:7px}.chapter-card::after{bottom:7px}
.chapter-card.show{animation:chapter-show 2.8s ease forwards}
.chapter-kicker{font-size:10px;letter-spacing:.42em;color:#d9b77c}
.chapter-card h2{font-family:"STKaiti","KaiTi","Songti SC",serif;font-size:clamp(23px,3vw,34px);margin:8px 0 2px;letter-spacing:.18em;color:#ffe4ad;text-shadow:0 3px 0 rgba(0,0,0,.3)}
.chapter-card p{margin:0;font-family:"STKaiti","KaiTi","Songti SC",serif;font-size:clamp(18px,2.2vw,26px);letter-spacing:.12em;color:#f4d9a6}
.chapter-rule{display:flex;align-items:center;justify-content:center;gap:12px;margin:12px auto 8px;width:72%;color:#c59550}
.chapter-rule i{height:1px;flex:1;background:linear-gradient(90deg,transparent,#9d6e3c)}
.chapter-rule i:last-child{background:linear-gradient(90deg,#9d6e3c,transparent)}
.chapter-rule b{font-size:10px}
.chapter-card small{font-size:10px;letter-spacing:.24em;color:#bda27b}
@keyframes chapter-show{
  0%{opacity:0;transform:translate(-50%,8px)}
  12%{opacity:1;transform:translate(-50%,0)}
  78%{opacity:1;transform:translate(-50%,0)}
  100%{opacity:0;transform:translate(-50%,-8px)}
}
/* ---------- 对话框（星露谷式木框） ---------- */
.dialogue-wrap{
  position:absolute;z-index:20;left:50%;bottom:max(18px,env(safe-area-inset-bottom));
  width:min(1120px,calc(100% - 40px));transform:translateX(-50%);
  animation:dialogue-in .32s ease-out both;
}
@keyframes dialogue-in{from{opacity:0;transform:translate(-50%,12px)}to{opacity:1;transform:translate(-50%,0)}}
.dialogue-box{
  position:relative;display:flex;gap:clamp(14px,1.8vw,24px);
  padding:clamp(15px,1.8vw,24px) clamp(18px,2.2vw,30px) clamp(14px,1.5vw,20px);
  min-height:clamp(145px,17vh,190px);
  background:
    linear-gradient(90deg,rgba(100,58,30,.055) 1px,transparent 1px) 0 0/17px 100%,
    repeating-linear-gradient(0deg,rgba(102,62,35,.045) 0 1px,transparent 1px 5px),
    radial-gradient(ellipse at 35% 0%,rgba(255,251,229,.55),transparent 58%),
    linear-gradient(180deg,#f8e8c6,#eed3a1 58%,#e4c48e);
  border:clamp(4px,0.45vw,6px) solid #352014;
  border-radius:5px;
  box-shadow:
    0 0 0 2px #a46a3f,
    0 0 0 5px #25140d,
    inset 0 0 0 2px rgba(255,246,218,.55),
    inset 0 0 35px rgba(104,55,20,.18),
    0 22px 48px rgba(0,0,0,.62);
  cursor:pointer;
}
.dialogue-box::after{
  content:"";position:absolute;inset:6px;border:1px solid rgba(109,64,32,.22);border-radius:2px;pointer-events:none;
}
.box-pin,.frame-pin{
  position:absolute;width:7px;height:7px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#ffe2a7,#a66a37 65%,#61361d);
  box-shadow:0 1px 1px rgba(0,0,0,.5);pointer-events:none;
}
.box-pin.b1{left:7px;top:7px}.box-pin.b2{right:7px;top:7px}
.box-pin.b3{left:7px;bottom:7px}.box-pin.b4{right:7px;bottom:7px}
.frame-pin{width:5px;height:5px}
.frame-pin.p1{left:5px;top:5px}.frame-pin.p2{right:5px;top:5px}
.frame-pin.p3{left:5px;bottom:5px}.frame-pin.p4{right:5px;bottom:5px}
.portrait-frame{
  position:relative;flex:0 0 clamp(94px,10.5vw,132px);width:clamp(94px,10.5vw,132px);
  aspect-ratio:1;align-self:flex-start;margin-top:3px;
  background:#22150e;border:4px solid #392014;border-radius:3px;
  box-shadow:0 0 0 2px #b57b49,inset 0 0 18px rgba(0,0,0,.55);
  overflow:hidden;
}
.portrait{position:absolute;inset:3px;overflow:hidden;background:#2c1c14;border:1px solid rgba(255,230,180,.25)}
.portrait svg{width:100%;height:100%;display:block;image-rendering:pixelated;animation:portrait-bob 4.5s ease-in-out infinite alternate}
@keyframes portrait-bob{from{transform:translateY(0)}to{transform:translateY(2px)}}
.dialogue-main{position:relative;flex:1;min-width:0;padding-top:3px;display:flex;flex-direction:column}
.nameplate{
  position:absolute;left:-4px;top:-31px;z-index:2;
  min-width:120px;padding:4px 19px 5px;text-align:center;
  background:linear-gradient(180deg,#6d4328,#482918);
  border:2px solid #2c180f;border-radius:2px;
  box-shadow:inset 0 1px 0 rgba(255,229,180,.24),0 0 0 2px #a56e41,0 4px 8px rgba(0,0,0,.25);
  transform:rotate(-.4deg);
}
.nameplate::after{
  content:"";position:absolute;left:12px;right:12px;bottom:2px;height:1px;background:linear-gradient(90deg,transparent,rgba(236,190,118,.55),transparent);
}
.nameplate span{
  font-family:"STKaiti","KaiTi","Songti SC",serif;font-size:clamp(16px,1.5vw,20px);font-weight:800;
  letter-spacing:.16em;color:#ffe4ad;text-shadow:0 2px 0 rgba(0,0,0,.4);
}
.dialogue-text{
  flex:1;color:#332017;font-size:clamp(15px,1.55vw,21px);line-height:1.82;letter-spacing:.025em;
  min-height:3.6em;padding:5px 3px 2px;
  text-shadow:0 1px 0 rgba(255,250,229,.55);
  overflow-wrap:anywhere;
}
.dialogue-text em{font-style:normal;color:#8b3d2b;font-weight:700}
.continue-hint{
  align-self:flex-end;margin-top:8px;padding-right:5px;font-size:10px;letter-spacing:.16em;
  color:#7b5636;opacity:.85;white-space:nowrap;
}
.continue-hint .arrow{display:inline-block;margin-left:3px;color:#8c4b2b;animation:hint-blink 1.1s steps(2) infinite}
@keyframes hint-blink{0%,48%{transform:translateY(0);opacity:1}49%,100%{transform:translateY(2px);opacity:.25}}

/* 选项 */
.choices{display:flex;flex-direction:column;gap:7px;margin:6px 0 4px;max-height:32vh;overflow-y:auto;padding:2px 4px 2px 2px;scrollbar-width:thin;scrollbar-color:#8c603c transparent}
.choices.two-col{display:grid;grid-template-columns:1fr 1fr;gap:7px 9px}
.choice-btn{
  position:relative;display:flex;align-items:center;gap:10px;width:100%;text-align:left;
  padding:8px 13px 8px 34px;cursor:pointer;color:#f9e9c6;
  background:linear-gradient(180deg,#5e3a23,#4a2b19);
  border:2px solid #301a10;box-shadow:inset 0 1px 0 rgba(255,226,170,.18),0 2px 0 rgba(48,26,16,.45);
  border-radius:2px;font-size:clamp(13px,1.35vw,17px);line-height:1.35;letter-spacing:.03em;
  transition:transform .12s ease,background .16s ease,border-color .16s ease,color .16s;
  animation:choice-in .24s ease both;
}
.choice-btn:nth-child(2){animation-delay:.04s}.choice-btn:nth-child(3){animation-delay:.08s}.choice-btn:nth-child(4){animation-delay:.12s}
@keyframes choice-in{from{opacity:0;transform:translateX(-7px)}to{opacity:1;transform:translateX(0)}}
.choice-btn:hover,.choice-btn:focus-visible{
  background:linear-gradient(180deg,#7d5130,#5a351e);border-color:#c58b55;color:#fff5da;
  transform:translateX(3px);
}
.choice-btn .num{
  position:absolute;left:9px;top:50%;transform:translateY(-50%);
  width:17px;height:17px;display:grid;place-items:center;border-radius:2px;
  font-family:"Courier New",monospace;font-size:10px;color:#332017;
  background:#d6ad6e;border:1px solid #2e1b11;box-shadow:inset 0 1px 0 rgba(255,255,255,.55);
}
.choice-btn:hover .num{background:#f1cc88}
.choice-btn .arrow-r{margin-left:auto;color:#b78854;font-size:11px;opacity:0;transition:opacity .15s}
.choice-btn:hover .arrow-r{opacity:1}
.choice-btn.ending-node .num{background:#d9866d}

/* 对话框标题旁小提示 */
.speaker-narration .portrait{filter:saturate(.72) brightness(.85)}
.speaker-narration .nameplate{opacity:.9}

/* ---------- 通用按钮 ---------- */
.wood-btn{
  position:relative;display:inline-flex;align-items:center;justify-content:center;
  min-width:190px;padding:12px 30px;cursor:pointer;border-radius:3px;
  color:#fff0c9;font-family:"STKaiti","KaiTi","Songti SC",serif;font-weight:700;
  font-size:clamp(17px,1.6vw,21px);letter-spacing:.22em;text-shadow:0 2px 0 rgba(0,0,0,.42);
  background:
    linear-gradient(90deg,rgba(255,230,180,.07) 1px,transparent 1px) 0 0/13px 100%,
    linear-gradient(180deg,#8d5732,#643b23 68%,#52301c);
  border:3px solid #2d180e;
  box-shadow:inset 0 2px 0 rgba(255,220,160,.28),inset 0 -4px 0 rgba(42,22,12,.48),0 5px 0 #24130b,0 10px 22px rgba(0,0,0,.34);
  transition:transform .14s ease,filter .14s ease,box-shadow .14s ease;
}
.wood-btn:hover{transform:translateY(-2px);filter:brightness(1.1);box-shadow:inset 0 2px 0 rgba(255,220,160,.32),inset 0 -4px 0 rgba(42,22,12,.45),0 7px 0 #24130b,0 14px 26px rgba(0,0,0,.4)}
.wood-btn:active{transform:translateY(3px);box-shadow:inset 0 2px 0 rgba(255,220,160,.22),inset 0 -2px 0 rgba(42,22,12,.45),0 2px 0 #24130b}
.wood-btn.primary{background:
  linear-gradient(90deg,rgba(255,230,180,.08) 1px,transparent 1px) 0 0/13px 100%,
  linear-gradient(180deg,#a66c3e,#7a492b 68%,#603820);}
.wood-btn.primary::before{
  content:"";position:absolute;inset:5px;border:1px solid rgba(255,229,174,.2);pointer-events:none;
}
.wood-btn:disabled{opacity:.4;cursor:not-allowed;transform:none;filter:grayscale(.5)}
.text-btn{
  border:0;background:none;color:#d9bd8d;font-size:13px;letter-spacing:.18em;padding:8px 14px;cursor:pointer;
  text-decoration:underline;text-underline-offset:5px;text-decoration-color:rgba(217,189,141,.35);
  transition:color .15s;
}
.text-btn:hover{color:#ffe7b2}

/* ---------- 模态框 ---------- */
.modal{position:absolute;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;padding:22px;background:rgba(7,4,2,.78);backdrop-filter:blur(5px);animation:fade-in .25s ease both}
@keyframes fade-in{from{opacity:0}to{opacity:1}}
.modal-panel{
  width:min(650px,94vw);max-height:88dvh;overflow:auto;color:#3a2418;
  background:
    repeating-linear-gradient(0deg,rgba(111,70,38,.045) 0 1px,transparent 1px 5px),
    radial-gradient(ellipse at 50% 0%,#fff7de,#f0d6a4 80%);
  border:6px solid #342016;border-radius:4px;
  box-shadow:0 0 0 3px #b07847,0 28px 60px rgba(0,0,0,.58),inset 0 0 35px rgba(104,55,20,.18);
  padding:26px clamp(20px,4vw,40px) 24px;
}
.modal-head{text-align:center;margin-bottom:16px}
.modal-head .chapter-kicker{color:#8c5c31;letter-spacing:.35em}
.modal-head h2{font-family:"STKaiti","KaiTi","Songti SC",serif;font-size:clamp(28px,4vw,38px);margin:6px 0 0;color:#4a2a1a;letter-spacing:.12em}
.help-lead{font-size:14px;line-height:1.9;margin:0 0 14px;color:#5d3c28;padding-bottom:13px;border-bottom:1px dashed rgba(114,72,42,.35)}
.help-list{list-style:none;padding:0;margin:0 0 14px;display:flex;flex-direction:column;gap:10px}
.help-list li{display:flex;gap:11px;align-items:flex-start;font-size:12.5px;line-height:1.75;color:#63412a}
.help-list li>span{flex:none;width:26px;height:26px;display:grid;place-items:center;margin-top:2px;font-family:"Courier New",monospace;font-size:10px;color:#ffe8ba;background:#80512f;border:1px solid #3a2114;border-radius:2px}
.help-list b{display:block;color:#40251a;font-size:13px;letter-spacing:.05em;margin-bottom:1px}
.help-tip{padding:10px 13px;background:rgba(255,248,225,.52);border-left:3px solid #b3844e;font-size:12px;line-height:1.7;color:#6b4932}
.help-tip i{display:inline-block;font-style:normal;color:#8f3e2b;font-weight:700;margin-right:6px}
.modal-panel>.wood-btn{display:flex;margin:19px auto 0}
/* ---------- 标题页 ---------- */
.title-screen{
  position:absolute;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;
  overflow:hidden;transition:opacity .55s ease,visibility .55s;
}
.title-screen.leaving{opacity:0;visibility:hidden}
.title-shade{
  position:absolute;inset:0;
  background:
    radial-gradient(ellipse at 50% 38%,rgba(16,8,3,.05) 0%,rgba(16,8,3,.26) 44%,rgba(9,5,2,.82) 100%),
    linear-gradient(to bottom,rgba(9,5,2,.25),rgba(9,5,2,.06) 38%,rgba(9,5,2,.74) 100%);
}
.title-content{position:relative;z-index:2;text-align:center;transform:translateY(-2.5vh);padding:20px;animation:title-in .9s cubic-bezier(.2,.8,.2,1) both}
@keyframes title-in{from{opacity:0;transform:translateY(0)}to{opacity:1;transform:translateY(-2.5vh)}}
.title-eyebrow{
  margin:0 0 12px;font-size:clamp(9px,1vw,12px);letter-spacing:.48em;color:#e4c68e;
  text-shadow:0 2px 4px rgba(0,0,0,.8);padding-left:.48em;
}
.game-logo{
  position:relative;display:inline-flex;align-items:baseline;gap:.03em;margin:0;
  font-family:"STKaiti","KaiTi","Songti SC","SimSun",serif;font-weight:900;
  font-size:clamp(64px,12.5vw,160px);line-height:.95;letter-spacing:.055em;color:#ffe7b0;
  text-shadow:
    0 3px 0 #a56932,0 6px 0 #6c4022,0 9px 0 #3b2112,
    0 16px 34px rgba(0,0,0,.65),0 0 55px rgba(232,175,82,.22);
  filter:drop-shadow(0 2px 0 rgba(255,242,200,.25));
}
.game-logo span{display:inline-block;transform:rotate(-1.5deg)}
.game-logo em{
  display:inline-block;font-style:normal;font-size:.78em;color:#efc46f;transform:translateY(-.06em) rotate(1deg);
  text-shadow:0 3px 0 #9a602c,0 6px 0 #5a341c,0 9px 0 #301b10,0 14px 28px rgba(0,0,0,.6);
}
.logo-seal{
  position:absolute;top:17%;right:-3.8rem;width:clamp(34px,4.8vw,56px);height:clamp(34px,4.8vw,56px);
  display:grid;place-items:center;font-family:"STKaiti","KaiTi",serif;font-weight:900;
  font-size:clamp(20px,2.9vw,34px);color:#f7d9a6;background:#9f2f2b;border:2px solid #581613;
  transform:rotate(8deg);box-shadow:inset 0 0 0 2px rgba(255,219,170,.25),0 5px 12px rgba(0,0,0,.4);
  opacity:.9;
}
.title-sub{margin:9px 0 0;font-family:"STKaiti","KaiTi","Songti SC",serif;font-size:clamp(18px,2.3vw,30px);letter-spacing:.32em;color:#f5dfb5;text-shadow:0 2px 6px rgba(0,0,0,.75);padding-left:.32em}
.title-quote{
  margin:22px auto 0;font-family:"STKaiti","KaiTi","Songti SC",serif;font-size:clamp(13px,1.45vw,18px);
  line-height:1.85;color:#d7bd93;letter-spacing:.09em;text-shadow:0 2px 5px rgba(0,0,0,.8);
}
.title-menu{display:flex;flex-direction:column;align-items:center;gap:11px;margin-top:26px}
.title-menu .wood-btn{min-width:238px}
.title-meta{margin:18px 0 0;font-size:9.5px;letter-spacing:.25em;color:rgba(224,199,156,.62)}
.title-footer{
  position:absolute;z-index:3;left:0;right:0;bottom:18px;display:flex;justify-content:center;flex-wrap:wrap;gap:8px;
  font-size:9px;letter-spacing:.16em;color:rgba(230,207,165,.48);text-shadow:0 1px 3px #000;
}
.title-footer .dot{color:rgba(230,207,165,.25)}
.title-screen.no-continue .title-meta{margin-top:19px}

/* ---------- 结局页 ---------- */
.ending-screen{
  position:absolute;inset:0;z-index:55;display:flex;align-items:center;justify-content:center;padding:22px;
  background:linear-gradient(180deg,rgba(8,5,3,.74),rgba(8,5,3,.35) 30%,rgba(8,5,3,.82));
  backdrop-filter:blur(2px);animation:fade-in .5s ease both;overflow-y:auto;
}
.ending-card{
  position:relative;width:min(820px,94vw);max-height:92dvh;overflow-y:auto;padding:clamp(24px,4vw,46px) clamp(22px,5vw,58px) 30px;
  color:#3d261a;text-align:center;
  background:
    repeating-linear-gradient(0deg,rgba(111,70,38,.035) 0 1px,transparent 1px 5px),
    radial-gradient(ellipse at 50% 5%,#fff9e9,#f1d9aa 68%,#e5c58d);
  border:7px solid #342016;border-radius:5px;
  box-shadow:0 0 0 3px #b07847,0 30px 80px rgba(0,0,0,.68),inset 0 0 50px rgba(103,58,23,.16);
  scrollbar-width:thin;scrollbar-color:#9a6b42 transparent;
}
.ending-card::before{content:"";position:absolute;inset:12px;border:1px solid rgba(124,77,40,.28);pointer-events:none}
.ending-kicker{font-size:9px;letter-spacing:.5em;color:#8d5c30;margin-bottom:9px}
.ending-title{font-family:"STKaiti","KaiTi","Songti SC",serif;font-size:clamp(38px,6vw,68px);line-height:1.05;letter-spacing:.1em;margin:0;color:#472819;text-shadow:0 2px 0 rgba(255,249,229,.8),0 4px 0 rgba(116,68,31,.13)}
.ending-sub{font-family:"STKaiti","KaiTi","Songti SC",serif;font-size:clamp(14px,1.65vw,20px);letter-spacing:.16em;color:#8d5c30;margin:8px 0 0}
.ending-rule{display:flex;align-items:center;gap:12px;width:62%;margin:18px auto;color:#a87945}
.ending-rule i{height:1px;flex:1;background:linear-gradient(90deg,transparent,#b78a54)}
.ending-rule i:last-child{background:linear-gradient(90deg,#b78a54,transparent)}
.ending-rule b{font-size:10px}
.ending-portrait{width:clamp(88px,10vw,118px);height:clamp(88px,10vw,118px);margin:0 auto 16px;border:4px solid #3c2417;box-shadow:0 0 0 2px #b57b49,0 7px 16px rgba(76,43,20,.24);background:#2a1911;overflow:hidden;transform:rotate(-1.2deg)}
.ending-portrait svg{width:100%;height:100%;display:block}
.ending-copy{max-width:620px;margin:0 auto;text-align:left;font-size:clamp(12.5px,1.35vw,15px);line-height:2;color:#5d3e2a;letter-spacing:.025em}
.ending-copy p{margin:0 0 11px}
.ending-copy p:last-child{margin-bottom:0}
.ending-quote{
  max-width:580px;margin:20px auto 0;padding:13px 22px;font-family:"STKaiti","KaiTi","Songti SC",serif;
  font-size:clamp(15px,1.8vw,20px);letter-spacing:.08em;line-height:1.65;color:#7d3c29;
  border-top:1px solid rgba(122,74,40,.3);border-bottom:1px solid rgba(122,74,40,.3);
}
.ending-stats{display:flex;justify-content:center;gap:clamp(15px,4vw,44px);margin:20px auto 4px;flex-wrap:wrap}
.ending-stat{min-width:80px}
.ending-stat span{display:block;font-size:9px;letter-spacing:.22em;color:#8b5b33;margin-bottom:4px}
.ending-stat b{font-family:"Courier New",monospace;font-size:22px;color:#472a1b}
.ending-stat b small{font-size:10px;color:#99724e}
.ending-grade{
  display:inline-flex;align-items:center;gap:10px;margin:9px auto 0;padding:6px 16px;
  border:1px solid rgba(125,76,36,.34);background:rgba(255,249,231,.42);font-size:10px;letter-spacing:.16em;color:#79512f;
}
.ending-grade b{font-family:"Courier New",monospace;font-size:16px;color:#8b3d2b}
.ending-meta{font-size:9px;letter-spacing:.16em;color:#99734e;margin:12px 0 0}
.ending-actions{display:flex;justify-content:center;gap:12px;flex-wrap:wrap;margin-top:21px}
.ending-actions .wood-btn{min-width:150px;font-size:16px;padding:10px 22px}
.ending-copy .flag-line{color:#8b3d2b}
.ending-stamp{
  position:absolute;right:clamp(20px,4vw,42px);top:clamp(20px,4vw,38px);width:clamp(50px,6vw,70px);height:clamp(50px,6vw,70px);
  display:grid;place-items:center;border:3px double rgba(144,44,37,.65);border-radius:50%;color:rgba(144,44,37,.78);
  font-family:"STKaiti","KaiTi",serif;font-size:clamp(12px,1.4vw,16px);line-height:1.1;text-align:center;
  transform:rotate(9deg);letter-spacing:.08em;pointer-events:none;
}
/* ---------- 考验 / 小游戏 ---------- */
.task-overlay{
  position:absolute;inset:0;z-index:32;display:flex;align-items:center;justify-content:center;
  padding:clamp(18px,4vh,54px) 18px;overflow-y:auto;
  background:radial-gradient(ellipse at 50% 42%,rgba(32,18,10,.68),rgba(7,4,2,.9) 78%);
  backdrop-filter:blur(6px);animation:fade-in .32s ease both;
}
.task-panel{
  position:relative;width:min(920px,96vw);min-height:min(560px,82dvh);max-height:94dvh;
  display:flex;flex-direction:column;overflow:hidden;
  background:#26150e;border:6px solid #1c0f09;border-radius:5px;
  box-shadow:0 0 0 3px #9d6839,0 30px 80px rgba(0,0,0,.72);
  animation:task-panel-in .4s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes task-panel-in{from{opacity:0;transform:translateY(16px) scale(.985)}to{opacity:1;transform:none}}
.task-head{
  position:relative;flex:none;padding:clamp(17px,2.4vw,26px) clamp(20px,3.5vw,40px) clamp(15px,2vw,22px);
  color:#f8e2b4;text-align:center;
  background:
    linear-gradient(90deg,rgba(255,233,185,.055) 1px,transparent 1px) 0 0/19px 100%,
    radial-gradient(ellipse at 50% 0%,rgba(173,111,55,.38),transparent 62%),
    linear-gradient(180deg,#4d2e1c,#2f1b11);
  border-bottom:3px solid #180d08;
  box-shadow:inset 0 -1px 0 rgba(232,184,103,.2);
}
.task-kicker{display:block;font-size:9px;letter-spacing:.44em;color:#d7ae71;text-transform:uppercase}
.task-head h2{font-family:"STKaiti","KaiTi","Songti SC",serif;font-size:clamp(23px,3.4vw,36px);letter-spacing:.1em;margin:5px 0 2px;color:#ffe6b3;text-shadow:0 3px 0 rgba(0,0,0,.35)}
.task-head p{margin:0 auto;max-width:650px;font-size:11.5px;line-height:1.7;color:#cbb18a;letter-spacing:.04em}
.task-body{flex:1;min-height:0;overflow-y:auto;background:
  repeating-linear-gradient(0deg,rgba(117,74,39,.045) 0 1px,transparent 1px 5px),
  radial-gradient(ellipse at 50% 8%,#fff7df,#efd5a2 78%);
  color:#3d2619;padding:clamp(16px,2.8vw,28px) clamp(16px,3.8vw,36px) clamp(18px,2.8vw,28px);
  scrollbar-width:thin;scrollbar-color:#92643e transparent;
}
.task-body::-webkit-scrollbar{width:9px}
.task-body::-webkit-scrollbar-thumb{background:#92643e;border:2px solid #efd5a2;border-radius:8px}
.task-intro{max-width:670px;margin:0 auto;text-align:center;display:flex;flex-direction:column;align-items:center;animation:fade-in .35s ease both}
.task-intro-icon{
  width:70px;height:70px;flex:none;display:grid;place-items:center;margin:2px 0 12px;border-radius:50%;
  background:radial-gradient(circle at 42% 35%,#ffe5a8,#c78a4c 72%);
  border:3px solid #4a2b19;box-shadow:0 5px 0 rgba(65,35,18,.26),inset 0 0 0 3px rgba(255,245,214,.35);
  font-family:"STKaiti","KaiTi",serif;font-size:34px;color:#4a2a17;transform:rotate(-3deg);
}
.task-intro blockquote{
  margin:0 0 13px;padding:10px 18px;font-family:"STKaiti","KaiTi","Songti SC",serif;font-size:clamp(15px,1.8vw,20px);
  line-height:1.6;color:#6d3c25;border-left:2px solid #b57b49;border-right:2px solid #b57b49;background:rgba(255,248,225,.4);
}
.task-intro > p{font-size:12.5px;line-height:1.85;color:#62422d;max-width:580px;margin:0 0 16px}
.howto{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;width:100%;max-width:640px;margin:0 0 19px}
.howto div{padding:9px 10px;background:rgba(255,249,231,.58);border:1px solid rgba(128,80,43,.3);font-size:10.5px;line-height:1.55;color:#6b4932;text-align:left}
.howto b{display:block;font-size:9px;letter-spacing:.15em;color:#9b4d35;margin-bottom:3px}
.task-intro .wood-btn{min-width:180px}
.task-note{margin-top:10px;font-size:9px;letter-spacing:.12em;color:#977454}

/* 通用游戏头部 */
.game-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px;flex-wrap:wrap}
.game-bar .bar-left{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.round-pill,.score-pill{
  display:inline-flex;align-items:center;gap:5px;padding:4px 10px;font-size:10px;letter-spacing:.12em;
  color:#6a4327;background:rgba(255,249,231,.7);border:1px solid rgba(125,76,36,.3);border-radius:2px;
}
.score-pill b{font-family:"Courier New",monospace;font-size:14px;color:#8b3d2b}
.time-track{flex:1;min-width:100px;max-width:310px;height:9px;background:#c9a774;border:1px solid #6b452b;box-shadow:inset 0 1px 2px rgba(63,35,17,.3)}
.time-track i{display:block;height:100%;width:100%;background:linear-gradient(90deg,#6f9b73,#d5b45e);transition:width .15s linear}
.time-track.low i{background:linear-gradient(90deg,#b54b3c,#d8835a)}
.game-prompt{font-size:12px;line-height:1.65;color:#674530;text-align:center;margin:0 0 12px}
.game-prompt b{color:#8b3d2b}
.mini-feedback{min-height:23px;text-align:center;font-family:"STKaiti","KaiTi",serif;font-size:16px;color:#8b4b2e;letter-spacing:.08em}
.mini-feedback.good{color:#3f7758}.mini-feedback.bad{color:#a84232}
.game-actions{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:13px;flex-wrap:wrap}
.game-btn{
  cursor:pointer;padding:9px 24px;min-width:135px;color:#ffe9bb;font-family:"STKaiti","KaiTi",serif;
  font-size:17px;letter-spacing:.12em;border:2px solid #2d180e;border-radius:2px;
  background:linear-gradient(180deg,#8e5832,#613920);box-shadow:inset 0 1px 0 rgba(255,230,180,.25),0 3px 0 #24130b;
  transition:filter .14s,transform .14s;
}
.game-btn:hover{filter:brightness(1.12);transform:translateY(-1px)}
.game-btn:active{transform:translateY(2px);box-shadow:inset 0 1px 0 rgba(255,230,180,.2),0 1px 0 #24130b}
.game-btn.ghost{background:rgba(255,249,231,.48);color:#6a4227;border-color:#9b6b42;box-shadow:none}
.game-btn:disabled{opacity:.38;cursor:not-allowed;transform:none}
.key-hint{font-family:"Courier New",monospace;font-size:9px;padding:2px 5px;border:1px solid rgba(255,255,255,.25);border-radius:2px;margin-left:5px;opacity:.7}

/* 菜品卡片 */
.dish-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:clamp(6px,.9vw,10px);margin:12px 0 2px}
.dish-card{
  position:relative;display:flex;flex-direction:column;align-items:center;gap:3px;
  padding:9px 5px 8px;cursor:pointer;color:#4e3322;border:2px solid rgba(120,73,38,.32);
  background:rgba(255,250,235,.62);border-radius:3px;transition:transform .12s,background .15s,border-color .15s,box-shadow .15s;
}
.dish-card:hover{transform:translateY(-2px);background:#fff8e7;border-color:#a16d3f;box-shadow:0 4px 10px rgba(95,55,26,.14)}
.dish-card.selected{border-color:#a44232;background:#fff0d5;box-shadow:inset 0 0 0 2px rgba(164,66,50,.18),0 4px 10px rgba(95,55,26,.16)}
.dish-card.selected::after{
  content:"✓";position:absolute;right:5px;top:4px;width:15px;height:15px;display:grid;place-items:center;
  font-size:10px;color:#fff4d6;background:#9b4030;border-radius:50%;
}
.dish-card.correct{border-color:#4f8764;background:#e8f0d8;box-shadow:inset 0 0 0 2px rgba(79,135,100,.2)}
.dish-card.wrong{border-color:#ad4939;background:#f8ddd1;animation:shake .35s ease}
.dish-card.dim{opacity:.36}
.dish-card .dish-art{width:clamp(34px,4vw,46px);height:clamp(34px,4vw,46px);display:grid;place-items:center;border-radius:50%;background:radial-gradient(circle at 50% 46%,#fffdf4,#eadbbd 72%);box-shadow:inset 0 0 0 2px rgba(129,85,46,.13),0 2px 3px rgba(88,51,23,.12)}
.dish-card .dish-art svg{width:88%;height:88%;display:block;image-rendering:pixelated}
.dish-card .dish-name{font-size:clamp(10px,1.1vw,13px);letter-spacing:.02em;line-height:1.2;text-align:center;white-space:nowrap}
.dish-card .dish-tag{font-size:8px;letter-spacing:.1em;color:#a37b57}
.dish-card.slim{padding:7px 4px 6px}
.dish-card.slim .dish-art{width:36px;height:36px}
.dish-card.slim .dish-name{font-size:10px}

/* 记忆点单 */
.memory-stage{max-width:720px;margin:0 auto}
.order-ticket{
  position:relative;max-width:560px;margin:5px auto 14px;padding:22px 24px 18px;text-align:center;
  background:#fff8e4;border:1px solid #cdb58b;box-shadow:0 7px 18px rgba(78,44,20,.14),inset 0 0 0 5px rgba(255,255,255,.5);
  transform:rotate(-.35deg);
}
.order-ticket::before,.order-ticket::after{content:"";position:absolute;left:0;right:0;height:8px;background:radial-gradient(circle at 5px -2px,transparent 6px,#efd9ad 6.5px) 0 0/14px 8px repeat-x}
.order-ticket::before{top:-1px}.order-ticket::after{bottom:-1px;transform:rotate(180deg)}
.order-ticket h3{font-family:"STKaiti","KaiTi",serif;margin:0 0 2px;font-size:22px;letter-spacing:.1em;color:#4b2d1b}
.order-ticket .ticket-sub{font-size:9px;letter-spacing:.26em;color:#a2784c;margin-bottom:13px}
.ticket-items{display:flex;justify-content:center;gap:clamp(9px,2vw,22px);flex-wrap:wrap}
.ticket-item{display:flex;flex-direction:column;align-items:center;gap:3px;min-width:70px;font-size:11px;color:#543722}
.ticket-item .dish-art{width:44px;height:44px}
.ticket-item .dish-art svg{width:100%;height:100%}
.ticket-timer{margin-top:12px;font-family:"Courier New",monospace;font-size:11px;color:#9b5e32;letter-spacing:.12em}
.ticket-timer b{color:#a43e2d;font-size:16px}
.peek-cover{display:flex;align-items:center;justify-content:center;min-height:220px;font-family:"STKaiti","KaiTi",serif;font-size:22px;color:#7c5435;letter-spacing:.2em}
.memory-actions{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:14px;flex-wrap:wrap}
.memory-count{font-size:10px;letter-spacing:.1em;color:#8b6849}
.memory-count b{font-family:"Courier New",monospace;color:#963e2d;font-size:14px}
.memory-summary{text-align:center;padding:18px 8px 4px}
.memory-summary .sum-score{font-family:"Courier New",monospace;font-size:42px;color:#8b3d2b;line-height:1}
.memory-summary .sum-label{font-size:10px;letter-spacing:.18em;color:#997451;margin:6px 0 10px}
.memory-summary p{font-size:12px;color:#65442e;line-height:1.7;margin:0}

/* 刀工 */
.knife-stage{max-width:700px;margin:0 auto}
.knife-scene{
  position:relative;height:clamp(150px,24vh,210px);margin:0 0 18px;overflow:hidden;border:2px solid #6b442a;border-radius:3px;
  background:
    linear-gradient(180deg,rgba(39,21,12,.14),transparent 34%),
    repeating-linear-gradient(90deg,rgba(112,70,36,.07) 0 1px,transparent 1px 21px),
    linear-gradient(180deg,#b7824e,#8a5a35 66%,#654022);
  box-shadow:inset 0 0 25px rgba(43,22,10,.38);
}
.knife-scene::after{content:"";position:absolute;left:0;right:0;bottom:0;height:22px;background:linear-gradient(180deg,rgba(64,35,18,.1),rgba(48,25,12,.25))}
.board{position:absolute;left:8%;right:8%;bottom:34px;height:44%;background:linear-gradient(90deg,#d2a469,#bd8b53 60%,#a97845);border:4px solid #6a4227;border-radius:3px;box-shadow:0 7px 0 rgba(58,31,14,.28),inset 0 0 0 2px rgba(255,234,190,.18)}
.board::before{content:"";position:absolute;inset:7px;border:1px solid rgba(92,52,24,.25);border-radius:2px}
.radish{position:absolute;left:47%;top:13%;width:23%;height:38%;background:linear-gradient(180deg,#f3d4a8,#dfaa72);border:3px solid #8c5730;border-radius:36% 42% 28% 35%;box-shadow:inset 5px 5px 0 rgba(255,248,223,.28)}
.radish::after{content:"";position:absolute;left:35%;top:-31%;width:5px;height:35%;background:#5d7b49;border:2px solid #36502b;border-radius:2px 2px 0 0;transform:rotate(12deg)}
.chopped{position:absolute;left:12%;bottom:12%;width:65%;height:36%;display:flex;gap:3px;align-items:flex-end;flex-wrap:wrap-reverse;align-content:flex-start}
.chopped i{display:block;width:clamp(7px,.9vw,10px);height:clamp(8px,1.1vw,13px);background:linear-gradient(180deg,#f7d9ac,#db9e63);border:1px solid #9c6338;border-radius:2px;opacity:0;animation:chop-drop .35s ease forwards}
@keyframes chop-drop{from{opacity:0;transform:translateY(-12px) rotate(-25deg)}to{opacity:1;transform:translateY(0) rotate(0)}}
.chef-knife{position:absolute;left:50%;top:-9%;width:clamp(80px,12vw,126px);height:auto;transform:translateX(-50%) rotate(-7deg);transform-origin:70% 80%;filter:drop-shadow(0 5px 3px rgba(38,20,9,.35));transition:transform .1s}
.chef-knife.chopping{animation:knife-chop .18s ease}
@keyframes knife-chop{0%{transform:translateX(-50%) rotate(-7deg) translateY(0)}45%{transform:translateX(-50%) rotate(-7deg) translateY(22px)}100%{transform:translateX(-50%) rotate(-7deg) translateY(0)}}
.knife-flash{position:absolute;left:50%;top:31%;width:36px;height:4px;background:#fff7d1;border-radius:50%;filter:blur(1px);opacity:0;transform:translateX(-50%) rotate(-12deg);pointer-events:none}
.knife-flash.on{animation:flash .22s ease-out}
@keyframes flash{0%{opacity:1;transform:translateX(-50%) scaleX(.4)}100%{opacity:0;transform:translateX(-50%) scaleX(1.8)}}
.rhythm-panel{padding:13px 16px 11px;background:rgba(255,249,231,.6);border:1px solid rgba(126,79,42,.3)}
.rhythm-track{position:relative;height:28px;margin:7px 0 4px;background:#6d4a2e;border:2px solid #3e2617;box-shadow:inset 0 3px 7px rgba(0,0,0,.35);overflow:hidden}
.rhythm-track::after{content:"";position:absolute;inset:0;background:repeating-linear-gradient(90deg,transparent 0 calc(10% - 1px),rgba(255,235,190,.15) calc(10% - 1px) 10%)}
.rhythm-zone{position:absolute;top:0;bottom:0;background:linear-gradient(180deg,#7eb07d,#4c825e);box-shadow:inset 0 0 0 1px rgba(240,255,214,.4),0 0 12px rgba(91,150,100,.42)}
.rhythm-marker{position:absolute;top:-4px;bottom:-4px;width:5px;margin-left:-2px;background:#ffe6a1;box-shadow:0 0 7px #ffd073,0 0 13px rgba(255,196,89,.7);z-index:2}
.rhythm-marker::before{content:"";position:absolute;left:50%;top:-5px;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:7px solid #ffe6a1;transform:translateX(-50%)}
.rhythm-labels{display:flex;justify-content:space-between;font-size:8px;letter-spacing:.15em;color:#9a7755}
.hit-btn{width:100%;margin-top:10px}
.cut-readout{display:flex;align-items:center;justify-content:center;gap:14px;font-size:10px;letter-spacing:.12em;color:#a24c34;margin-top:7px;min-height:20px}
.cut-readout b{font-family:"Courier New",monospace;font-size:14px;color:#8b3d2b}
.cut-dots{display:flex;gap:4px;justify-content:center;margin-top:8px}
.cut-dots i{width:14px;height:5px;background:#c8ad84;border:1px solid #9d7953;border-radius:1px}
.cut-dots i.hit{background:#5f8c68;border-color:#3f684a}
.cut-dots i.miss{background:#b35846;border-color:#823e30}
/* 火候 */
.fire-stage{max-width:720px;margin:0 auto}
.fire-layout{display:grid;grid-template-columns:1fr 120px;gap:clamp(12px,3vw,34px);align-items:center;min-height:260px}
.wok-area{position:relative;height:clamp(230px,38vh,310px);display:flex;flex-direction:column;align-items:center;justify-content:flex-end;padding-bottom:12px}
.wok-rim{position:relative;width:min(78%,330px);height:28px;background:linear-gradient(180deg,#67625c,#2f2e2c);border:3px solid #20201e;border-radius:50%;box-shadow:0 5px 0 rgba(34,28,23,.4),inset 0 4px 0 rgba(255,255,255,.15);z-index:2}
.wok-body{position:relative;width:min(66%,280px);height:100px;margin-top:-4px;background:radial-gradient(ellipse at 50% 8%,#4c4a46,#272624 63%,#171614);border-radius:0 0 50% 50%;border:3px solid #20201e;box-shadow:inset 0 12px 24px rgba(0,0,0,.55),0 11px 0 rgba(40,29,20,.25);z-index:3;overflow:hidden}
.wok-body::after{content:"";position:absolute;left:16%;right:16%;top:0;height:11px;border-radius:50%;background:#0e0d0b;box-shadow:inset 0 4px 7px #000}
.flames{position:relative;width:min(62%,260px);height:110px;margin-bottom:-18px;display:flex;align-items:flex-end;justify-content:center;gap:8px;z-index:1}
.flames i{
  display:block;width:22%;height:var(--h,55%);border-radius:50% 50% 46% 46%;
  background:linear-gradient(to top,#fff1a0 0 16%,#ffc34f 34%,#ef6e32 65%,rgba(218,62,30,.05));
  filter:blur(.3px);transform-origin:bottom center;animation:flame-dance .42s steps(3) infinite alternate;opacity:.9;
}
.flames i:nth-child(2){animation-delay:-.18s;height:calc(var(--h,55%) * 1.14)}
.flames i:nth-child(3){animation-delay:-.31s;height:calc(var(--h,55%) * .88)}
@keyframes flame-dance{from{transform:scaleY(.86) skewX(-3deg)}to{transform:scaleY(1.1) skewX(3deg)}}
.wok-food{position:absolute;left:50%;top:4px;transform:translateX(-50%);display:flex;gap:3px;z-index:2}
.wok-food i{display:block;width:9px;height:7px;background:#e58c45;border:1px solid #93451f;border-radius:50%}
.wok-food i:nth-child(2){background:#7ba155;border-color:#45622e;border-radius:3px}
.wok-food i:nth-child(3){background:#d5b04e;border-color:#8d6521}
.fire-dish{position:relative;z-index:4;margin-top:6px;font-family:"STKaiti","KaiTi",serif;font-size:clamp(18px,2.2vw,24px);letter-spacing:.13em;color:#51321f}
.fire-progress{margin-top:13px;padding:10px 14px;background:rgba(255,249,231,.62);border:1px solid rgba(126,79,42,.3)}
.fire-progress-top{display:flex;justify-content:space-between;font-size:9px;letter-spacing:.12em;color:#7c5638;margin-bottom:5px}
.fire-progress-top b{font-family:"Courier New",monospace;color:#9a3f2c;font-size:12px}
.fire-progress-track{height:12px;background:#d8bd91;border:1px solid #795031;box-shadow:inset 0 2px 3px rgba(79,43,20,.28)}
.fire-progress-track i{display:block;height:100%;width:0;background:linear-gradient(90deg,#de9c43,#ecce62);transition:width .1s linear}
.fire-gauge{
  position:relative;height:clamp(220px,33vh,290px);width:88px;justify-self:center;
  background:linear-gradient(90deg,#3c2719,#6b452d 48%,#3a2518);border:2px solid #2b180f;border-radius:4px;
  box-shadow:inset 0 0 0 2px rgba(255,226,169,.15),0 6px 14px rgba(64,34,18,.22);
}
.gauge-inner{position:absolute;left:17px;right:17px;top:14px;bottom:14px;background:linear-gradient(to top,#e7cb92,#b9150e 42%,#e77b2c 68%,#ffd774 100%);border:1px solid #28160c;box-shadow:inset 0 0 8px rgba(0,0,0,.4)}
.gauge-target{position:absolute;left:11px;right:11px;background:rgba(54,121,78,.55);border:2px solid #d7f1a6;box-shadow:0 0 10px rgba(141,218,118,.5);z-index:2}
.gauge-target::before{content:"";position:absolute;inset:2px;border:1px dashed rgba(255,248,206,.42)}
.gauge-needle{position:absolute;left:7px;right:7px;height:4px;background:#fff4c2;box-shadow:0 0 7px #fff2a9,0 0 14px #ffb341;z-index:3;transform:translateY(50%)}
.gauge-needle::before{content:"";position:absolute;right:-1px;top:50%;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:8px solid #fff4c2;transform:translateY(-50%)}
.gauge-label{position:absolute;left:50%;transform:translateX(-50%);font-size:8px;letter-spacing:.12em;color:#f4d89e;text-shadow:0 1px 2px #000;white-space:nowrap}
.gauge-label.top{top:-1px}.gauge-label.bottom{bottom:-1px}
.fire-controls{display:flex;flex-direction:column;align-items:center;gap:5px;margin-top:12px}
.bellows-btn{width:min(300px,90%);padding:11px 20px;font-size:17px;touch-action:none}
.bellows-btn.pressed{transform:translateY(3px) scale(.99);filter:brightness(1.23);box-shadow:inset 0 2px 0 rgba(255,230,180,.2),0 1px 0 #24130b}
.fire-hint{font-size:9px;letter-spacing:.1em;color:#987451}

/* 调味 */
.season-stage{max-width:720px;margin:0 auto}
.recipe-card{padding:14px 20px;background:#fff9e7;border:1px solid #cbb086;box-shadow:inset 0 0 0 4px rgba(255,255,255,.55);text-align:center;position:relative;margin-bottom:11px}
.recipe-card::before{content:"";position:absolute;left:50%;top:-7px;width:68px;height:14px;background:rgba(210,176,126,.7);transform:translateX(-50%) rotate(-1deg)}
.recipe-card h3{font-family:"STKaiti","KaiTi",serif;font-size:clamp(21px,2.6vw,28px);letter-spacing:.13em;margin:0 0 3px;color:#4c2e1b}
.recipe-card p{font-size:11.5px;line-height:1.7;color:#77563a;margin:0}
.recipe-card .secret{font-size:9px;letter-spacing:.2em;color:#9e7a52;margin-top:5px}
.season-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:12px 0}
.season-card{display:flex;flex-direction:column;align-items:center;gap:4px;padding:8px 4px;cursor:pointer;background:rgba(255,249,231,.62);border:2px solid rgba(121,75,40,.28);border-radius:3px;color:#553926;transition:.14s}
.season-card:hover{transform:translateY(-2px);background:#fff9e9;border-color:#a47446}
.season-card.selected{border-color:#9e4937;background:#fff0d2;box-shadow:inset 0 0 0 2px rgba(158,73,55,.14)}
.season-card svg{width:36px;height:40px;image-rendering:pixelated}
.season-card span{font-size:11px;letter-spacing:.02em}
.season-card small{font-size:8px;color:#a07b58;letter-spacing:.08em}
.season-card.correct{border-color:#4f8764;background:#eaf1d9}
.season-card.wrong{border-color:#ad4939;background:#f8ddd1;animation:shake .35s ease}
.season-note{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:4px;min-height:22px}
.season-note .memory-count{font-size:10px}
.season-reveal{text-align:center;font-size:11px;line-height:1.6;color:#8b4b2f;min-height:19px}

/* 传菜 */
.service-stage{max-width:760px;margin:0 auto}
.service-counter{
  position:relative;display:flex;align-items:center;gap:16px;min-height:112px;padding:14px 18px;margin-bottom:12px;
  background:
    repeating-linear-gradient(90deg,rgba(116,73,38,.055) 0 1px,transparent 1px 19px),
    linear-gradient(180deg,#d6b47d,#b78955);border:2px solid #714b2e;
  box-shadow:inset 0 0 0 4px rgba(255,245,217,.2),0 5px 12px rgba(77,43,20,.16);
}
.service-counter::after{content:"";position:absolute;left:0;right:0;bottom:0;height:12px;background:linear-gradient(180deg,rgba(80,45,22,.1),rgba(74,40,19,.25))}
.table-block{flex:none;width:74px;text-align:center;position:relative;z-index:2}
.table-block .table-num{font-family:"Courier New",monospace;font-size:27px;font-weight:700;color:#6d4126;line-height:1;text-shadow:0 1px 0 rgba(255,245,214,.5)}
.table-block .table-label{font-size:8px;letter-spacing:.18em;color:#997048;margin-top:2px}
.order-bubble{position:relative;flex:1;z-index:2;padding:10px 16px;background:#fff9e7;border:2px solid #604029;border-radius:3px;box-shadow:0 5px 0 rgba(69,37,18,.18),inset 0 0 0 3px rgba(255,255,255,.45)}
.order-bubble::before{content:"";position:absolute;left:-9px;top:50%;border-top:8px solid transparent;border-bottom:8px solid transparent;border-right:10px solid #604029;transform:translateY(-50%)}
.order-bubble::after{content:"";position:absolute;left:-5px;top:50%;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:7px solid #fff9e7;transform:translateY(-50%)}
.order-bubble .order-label{font-size:8px;letter-spacing:.18em;color:#a27b54}
.order-bubble .order-name{font-family:"STKaiti","KaiTi",serif;font-size:clamp(19px,2.4vw,27px);color:#4e2e1b;letter-spacing:.07em;margin:1px 0 0}
.order-bubble .order-icon{position:absolute;right:12px;top:50%;width:52px;height:52px;transform:translateY(-50%)}
.order-bubble .order-icon svg{width:100%;height:100%;image-rendering:pixelated}
.service-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin-top:12px}
.service-feedback{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-family:"STKaiti","KaiTi",serif;font-size:26px;color:#fff0c0;text-shadow:0 2px 0 #6d2c1e,0 0 12px rgba(255,191,83,.7);pointer-events:none;opacity:0;z-index:5}
.service-feedback.show{animation:float-pop .5s ease-out}
@keyframes float-pop{0%{opacity:0;transform:translate(-50%,-35%) scale(.8)}25%{opacity:1;transform:translate(-50%,-50%) scale(1.1)}100%{opacity:0;transform:translate(-50%,-85%) scale(1)}}
.combo-badge{display:inline-flex;gap:4px;align-items:center;font-size:9px;color:#a24c34;letter-spacing:.1em}
.combo-badge b{font-family:"Courier New",monospace;font-size:14px}

/* 任务结算 */
.result-stage{max-width:700px;margin:0 auto;text-align:center;padding:6px 0 4px;animation:fade-in .4s ease both}
.result-seal{
  width:clamp(70px,9vw,96px);height:clamp(70px,9vw,96px);margin:0 auto 12px;display:grid;place-items:center;
  font-family:"STKaiti","KaiTi",serif;font-size:clamp(29px,4vw,42px);font-weight:900;
  color:#fff0cd;background:radial-gradient(circle at 38% 32%,#bd5b42,#862f26 70%,#5e1d18);
  border:4px double rgba(255,229,181,.75);border-radius:50%;transform:rotate(-4deg);
  box-shadow:0 8px 0 rgba(77,30,20,.2),inset 0 0 18px rgba(255,142,89,.28);
}
.result-seal.fail{background:radial-gradient(circle at 38% 32%,#a98655,#79603f 70%,#57442e);color:#f5e5bf}
.result-title{font-family:"STKaiti","KaiTi",serif;font-size:clamp(28px,4vw,42px);letter-spacing:.16em;color:#4d2c1a;margin:0}
.result-sub{font-size:10px;letter-spacing:.28em;color:#9a714b;margin:6px 0 12px}
.result-scoreline{display:flex;align-items:baseline;justify-content:center;gap:5px;font-family:"Courier New",monospace;color:#8b3d2b;margin:7px 0 12px}
.result-scoreline b{font-size:clamp(34px,5vw,50px);line-height:1}
.result-scoreline span{font-size:12px;color:#a27e5a}
.result-quote{max-width:540px;margin:0 auto 14px;font-size:12.5px;line-height:1.85;color:#65432d}
.result-effects{display:flex;justify-content:center;gap:7px;flex-wrap:wrap;margin:14px 0 0}
.effect-chip{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;font-size:10px;letter-spacing:.08em;background:rgba(255,249,231,.66);border:1px solid rgba(126,79,42,.3);color:#6b4932}
.effect-chip b{font-family:"Courier New",monospace;font-size:13px;color:#8b3d2b}
.effect-chip.down b{color:#a24c34}
.task-result .wood-btn{margin-top:17px;min-width:170px;font-size:17px;padding:10px 24px}
.result-stars{display:flex;justify-content:center;gap:5px;color:#b7863f;font-size:16px;letter-spacing:2px;margin:3px 0 2px}
.result-stars .off{color:#d3bd97}

/* 通用动画 */
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-4px)}50%{transform:translateX(4px)}75%{transform:translateX(-2px)}}

/* ---------- 响应式 ---------- */
@media (max-width:860px){
  .hud{gap:8px;padding:10px 12px 30px}
  .brand-mark{width:34px;height:34px;font-size:19px}
  .hud-left{min-width:0}
  .hud-chapter strong{font-size:16px}
  .stat-name{display:none}
  .stat{padding:0 6px}
  .stat-track{width:48px}
  .day-chip{display:none}
  .dialogue-wrap{width:calc(100% - 22px);bottom:max(11px,env(safe-area-inset-bottom))}
  .dialogue-box{padding:14px 16px 12px;gap:14px;min-height:0}
  .portrait-frame{flex-basis:94px;width:94px}
  .nameplate{top:-28px;padding:3px 14px 4px;min-width:100px}
  .dialogue-text{font-size:15px;line-height:1.75}
  .choices.max-height{max-height:30vh}
  .title-screen{overflow-y:auto}
  .title-content{transform:none;padding-top:14vh}
  .logo-seal{right:-2.3rem}
  .task-overlay{padding:10px}
  .task-panel{max-height:97dvh;min-height:0}
  .howto{grid-template-columns:1fr;gap:6px}
  .dish-grid{grid-template-columns:repeat(4,1fr)}
  .fire-layout{grid-template-columns:1fr 90px;gap:10px}
  .service-grid{grid-template-columns:repeat(4,1fr)}
  .ending-card{padding-top:30px}
  .ending-stamp{display:none}
}
@media (max-width:560px){
  .hud{padding:8px 9px 22px;align-items:center}
  .brand-mark{width:29px;height:29px;font-size:16px}
  .hud-chapter span{font-size:8px;letter-spacing:.2em}
  .hud-chapter strong{font-size:13px;letter-spacing:.03em}
  .hud-stats{gap:4px}
  .stat{height:25px;padding:0 4px;gap:3px}
  .stat-icon{width:15px;height:15px;font-size:10px}
  .stat-track{width:32px;height:6px}
  .stat b{display:none}
  .sound-btn{width:25px;height:25px;font-size:12px}
  .dialogue-wrap{width:calc(100% - 12px);bottom:max(6px,env(safe-area-inset-bottom))}
  .dialogue-box{padding:12px 13px 10px;border-width:4px;gap:10px}
  .portrait-frame{flex-basis:68px;width:68px;border-width:3px}
  .nameplate{top:-25px;left:0;padding:3px 11px 3px;min-width:82px}
  .nameplate span{font-size:14px}
  .dialogue-text{font-size:14px;line-height:1.7;min-height:3.4em;padding-top:2px}
  .continue-hint{font-size:8px;margin-top:5px}
  .choices{gap:5px;max-height:30vh}
  .choices.two-col{grid-template-columns:1fr}
  .choice-btn{padding:7px 9px 7px 30px;font-size:12.5px;border-width:1px}
  .choice-btn .num{width:15px;height:15px;font-size:9px;left:7px}
  .title-content{padding:16px 10px;padding-top:13vh}
  .game-logo{font-size:clamp(58px,18vw,92px)}
  .title-quote{font-size:12px;margin-top:16px}
  .title-menu{margin-top:20px;gap:8px}
  .title-menu .wood-btn{min-width:205px;padding:10px 22px;font-size:17px}
  .title-footer{font-size:7.5px;bottom:10px;padding:0 10px;text-align:center;gap:5px}
  .logo-seal{right:-1.7rem;width:31px;height:31px;font-size:17px}
  .chapter-card{top:13%;padding:18px 20px 15px}
  .chapter-card h2{font-size:24px}
  .chapter-card p{font-size:19px}
  .task-head{padding:14px 14px 11px}
  .task-head h2{font-size:23px}
  .task-head p{font-size:10px}
  .task-body{padding:14px 12px 16px}
  .task-intro-icon{width:56px;height:56px;font-size:28px}
  .dish-grid{grid-template-columns:repeat(4,1fr);gap:5px}
  .dish-card{padding:6px 2px 5px}
  .dish-card .dish-art{width:33px;height:33px}
  .dish-card .dish-name{font-size:9px}
  .dish-card .dish-tag{display:none}
  .order-ticket{padding:17px 12px 14px}
  .ticket-item{font-size:10px;min-width:57px}
  .ticket-item .dish-art{width:37px;height:37px}
  .fire-layout{grid-template-columns:1fr 74px;gap:6px}
  .wok-area{height:230px}
  .fire-gauge{width:70px;height:220px}
  .gauge-inner{left:14px;right:14px}
  .service-counter{gap:8px;padding:10px 10px;min-height:96px}
  .table-block{width:52px}
  .table-block .table-num{font-size:22px}
  .order-bubble{padding:8px 9px}
  .order-bubble .order-name{font-size:18px}
  .order-bubble .order-icon{display:none}
  .service-grid{gap:4px}
  .ending-screen{padding:10px}
  .ending-card{border-width:5px;padding:25px 17px 22px}
  .ending-title{font-size:38px}
  .ending-copy{font-size:12px}
  .ending-stats{gap:16px}
  .ending-actions .wood-btn{min-width:130px;font-size:14px;padding:8px 16px}
  .result-quote{font-size:11px}
  .modal{padding:12px}
  .modal-panel{padding:21px 16px 19px;border-width:4px}
  .ending-portrait{width:80px;height:80px}
}
@media (max-height:640px){
  .hud{padding-top:8px;padding-bottom:20px}
  .dialogue-wrap{bottom:8px}
  .dialogue-box{padding-top:12px;padding-bottom:10px}
  .portrait-frame{flex-basis:78px;width:78px}
  .dialogue-text{font-size:14px;line-height:1.65;min-height:3em}
  .title-content{transform:scale(.88)}
  .title-menu{margin-top:14px}
  .title-quote{margin-top:12px}
  .chapter-card{top:12%}
  .task-head{padding-top:12px;padding-bottom:10px}
  .task-head h2{font-size:23px}
  .task-intro-icon{width:52px;height:52px;font-size:26px}
  .task-intro blockquote{font-size:14px;padding:7px 12px}
  .task-intro>p{font-size:11px;margin-bottom:10px}
  .howto{margin-bottom:12px}
  .game-bar{margin-bottom:8px}
  .wok-area{height:200px}
  .fire-gauge{height:190px}
  .fire-layout{min-height:210px}
  .ending-card{max-height:96dvh}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms !important;animation-iteration-count:1 !important;scroll-behavior:auto !important;transition-duration:.001ms !important}
}
