/* ==========================================================================
 * 0. 设计令牌（颜色 / 尺寸 / 动效时长）
 *    统一在这里调整，避免样式散落各处导致视觉不对齐
 * ====================================================================== */
:root{
    --paper:#fdfaf3;            /* 主卡片纸色 */
    --paper-2:#fffdf8;          /* 次级卡片 */
    --ink:#2b2420;              /* 主文字 / 描边 */
    --ink-soft:#7d6b57;         /* 次要文字 */
    --ink-mute:#a08c74;         /* 更弱的说明文字 */
    --orange:#ef6a35;           /* 主题强调色 */
    --orange-deep:#b4471f;      /* 强调色阴影 */
    --orange-soft:#ffe7d8;      /* 强调色浅底 */
    --green:#3f9a54;
    --green-soft:#dcf1d9;
    --red:#cf4234;
    --red-soft:#fde3dd;
    --yellow:#ffe58a;
    --gold:#e2c98f;
    --cream:#fff3d6;
    --side:#d9ccb8;             /* 立体投影的中间色 */
    --side-deep:#a48d74;        /* 立体投影的深色 */
    --line:#e6d9c3;             /* 分割线 */
    --radius:16px;              /* 大圆角 */
    --radius-sm:10px;
    --shadow-card:0 0 0 3px var(--orange-soft), 0 8px 0 3px var(--yellow), 0 18px 28px rgba(43,36,32,.20);
    --shadow-pill:0 0 0 2px var(--ink), 0 3px 0 2px var(--side);
    --ease:cubic-bezier(.2,.8,.3,1);
}

/* ==========================================================================
 * 1. 基础重置与页面背景
 * ====================================================================== */
*{box-sizing:border-box;}
[hidden]{display:none !important;}
html,body{min-height:100%;}
/* 兜底色：内容不足一屏时，页面下方不会露出白底 */
html{min-height:100vh;background:#dccdb4;}
html{-webkit-text-size-adjust:100%;}
body.game-page{
    margin:0;
    padding:18px 14px 40px;
    overflow-x:hidden;
    color:var(--ink);
    font-family:"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Segoe UI",sans-serif;
    background:
            url("/static/imgs/bg-yellow-32eaa3ea087584dea9812fc0427315df.jpg") center center / cover no-repeat,
            linear-gradient(160deg, #fff8d6 0%, #ffe9a8 55%, #ffd97d 100%);
    background-blend-mode: normal;
    /*background-attachment:fixed;*/
}

body.game-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
            url("/static/imgs/bg-yellow-32eaa3ea087584dea9812fc0427315df.jpg") center center / cover no-repeat,
            linear-gradient(160deg, #fff8d6 0%, #ffe9a8 55%, #ffd97d 100%);
    opacity: .35;
    z-index: -1;
    pointer-events: none;
}

/*body.game-page::before{*/
/*    !* 极淡的纸纹，提升质感但不抢注意力 *!*/
/*    content:"";*/
/*    position:fixed; inset:0; z-index:-1; pointer-events:none;*/
/*    background-image:radial-gradient(rgba(120,95,65,.10) 1px, transparent 1px);*/
/*    background-size:22px 22px;*/
/*    opacity:.35;*/
/*}*/
a{color:var(--orange-deep);text-decoration:none;}
a:hover{text-decoration:underline;}
button{font-family:inherit;}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0;white-space:nowrap;}
.skip-link{
    position:absolute;left:12px;top:-60px;z-index:9000;padding:8px 14px;border-radius:8px;
    background:var(--ink);color:#fff;font-weight:700;transition:top .2s;
}
.skip-link:focus{top:12px;}

/* 统一焦点样式：键盘可达、视觉清晰 */
:focus-visible{outline:3px solid var(--orange);outline-offset:2px;}

/* 词表加载异常提示条（正常时不出现） */
.data-alert{
    max-width:1080px;margin:0 auto 10px;padding:10px 16px;border-radius:12px;
    background:var(--orange-soft);color:#8a3a12;font-size:13px;line-height:1.8;
    box-shadow:0 0 0 2px #e8b79c;
}
.data-alert b{color:#7a2f0d;}

/* ==========================================================================
 * 2. 页头：品牌 + 实时指标 + 操作按钮（三列网格，保证基线对齐）
 * ====================================================================== */
.game-shell{width:100%;max-width:1080px;margin:0 auto;}
.game-header{
    position:relative;z-index:2;            /* 明确层级：页头的立体投影不会被舞台压住 */
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-areas:
    "brand actions"
    "hud hud";
    align-items:center;
    gap:9px 18px;
    padding:12px 16px;
    background:var(--paper);
    border-radius:14px;
    box-shadow:0 0 0 2px var(--orange-soft), 0 4px 0 2px var(--yellow);
}
.game-brand{grid-area:brand;min-width:0;}
.brand-row{display:flex;align-items:center;gap:10px;min-width:0;}
.game-brand h1{
    display:flex;align-items:center;gap:8px;min-width:0;
    margin:0;font-size:19px;font-weight:900;letter-spacing:.5px;
    line-height:1.25;white-space:nowrap;
}
/* 标题后的「词表 · 关卡」切换器：一眼看到当前进度，点一下就能换 */
.brand-switch{
    flex:none;display:inline-flex;align-items:center;gap:6px;max-width:290px;
    margin:0;padding:3px 10px;border:1.5px solid var(--side);
    border-radius:999px;background:#fff;color:var(--ink-soft);
    font:inherit;font-size:11.5px;font-weight:800;line-height:1.6;white-space:nowrap;
    cursor:pointer;transition:background .15s,border-color .15s,transform .12s,color .15s;
}
.brand-switch:hover{background:var(--cream);border-color:var(--gold);color:var(--ink);transform:translateY(-1px);}
.brand-switch .glyphicon-education{color:var(--orange);font-size:12px;}
.brand-switch .glyphicon-chevron-down{font-size:9px;color:var(--ink-mute);}
.brand-switch span{overflow:hidden;text-overflow:ellipsis;}
.game-brand h1 .brand-kicker{
    display:inline-block;padding:1px 6px;border-radius:6px;
    background:var(--orange);color:#fff;font-size:11px;font-weight:800;letter-spacing:0;
}
.game-brand p{
    margin:3px 0 0;color:var(--ink-soft);font-size:11.5px;font-weight:700;line-height:1.4;
    white-space:nowrap;
}
/* 指标：五等分网格，数字用等宽数字避免跳动 */
.hud{
    grid-area:hud;
    display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;
    align-items:stretch;
}
.hud-item{
    display:flex;align-items:center;justify-content:center;gap:4px;
    min-width:0;min-height:38px;padding:4px 8px;
    border-radius:10px;background:#fff;
    box-shadow:var(--shadow-pill);
    font-size:13px;font-weight:800;line-height:1.1;
    transition:transform .15s var(--ease), box-shadow .15s var(--ease);
}
.hud-item>.glyphicon{color:var(--orange);font-size:13px;flex:none;}
.hud-item b{
    font-variant-numeric:tabular-nums;letter-spacing:.2px;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.hud-label{color:var(--ink-soft);font-size:10.5px;font-weight:700;white-space:nowrap;}
.hud-hearts>.glyphicon{color:var(--red);font-size:14px;margin-right:1px;}
.hud-hearts .lost{opacity:.2;}
.hud-item.is-pulse{animation:hudPulse .36s var(--ease);}
.hud-item.is-hot{box-shadow:0 0 0 2px var(--orange), 0 3px 0 2px #e0a83a;background:var(--cream);}
.hud-actions{grid-area:actions;display:flex;align-items:center;gap:5px;flex-wrap:wrap;justify-content:flex-end;}
.hud-actions .btn{
    border-radius:9px;font-weight:800;padding:6px 9px;font-size:12px;line-height:1;
    box-shadow:0 2px 0 rgba(43,36,32,.18);
}
.hud-actions .btn .glyphicon{font-size:12px;}
.hud-actions .btn-default{background:#fff;border-color:#dccbb2;color:var(--ink);}
.hud-actions .btn-warning{background:var(--yellow);border-color:#e0a83a;color:#7a4a00;}
.hud-actions .btn:hover{transform:translateY(-1px);}

/* 关键：允许网格子项收缩，否则内部内容的最小宽度会把整页撑宽（手机端最常见） */
.game-brand,.hud,.hud-actions,.game-panel,.game-pad,.word-slots,.tile-row,.kb{min-width:0;max-width:100%;}

/* ==========================================================================
 * 3. 舞台卡片
 * ====================================================================== */
.game-stage{
    position:relative;
    display:flex;flex-direction:column;
    width:100%;max-width:1080px;min-height:470px;
    margin:16px auto 0;overflow:hidden;   /* 关键：与页头拉开 16px，避免投影与描边叠在一起 */
    border-radius:var(--radius);
    background:
            radial-gradient(520px 240px at 8% -10%, rgba(255,231,216,.75), rgba(255,231,216,0) 70%),
            var(--paper);
    box-shadow:var(--shadow-card);
    isolation:isolate;
}
/* 顶部细进度条：整关进度可视化 */
.stage-top{display:flex;align-items:center;gap:10px;padding:10px 16px 0;}
.stage-top .lv-name{
    min-width:0;max-width:46%;font-size:12.5px;font-weight:800;color:var(--ink-soft);
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.stage-top .lv-progress{
    flex:1 1 auto;display:flex;gap:4px;height:9px;align-items:center;min-width:60px;
    border-radius:99px;padding:2px;background:#efe4d2;box-shadow:inset 0 0 0 1.5px #e0d1ba;
}
.lv-progress .seg{flex:1 1 0;height:5px;border-radius:99px;background:#fffdf7;transition:background .25s var(--ease),height .25s var(--ease);}
.lv-progress .seg.is-done{background:var(--orange);}
.lv-progress .seg.is-cur{background:var(--yellow);height:7px;}
.mode-badge{
    flex:none;padding:3px 9px;border-radius:99px;background:var(--cream);
    box-shadow:0 0 0 1.5px var(--gold);font-size:11px;font-weight:800;color:#8a5312;white-space:nowrap;
}
.mode-badge:empty{display:none;}

.game-main{
    flex:1 1 auto;display:grid;
    grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);
    align-items:stretch;gap:22px;
    padding:14px 24px 24px;min-height:0;
}

/* ---------- 左侧题面 ---------- */
.game-panel{
    display:flex;flex-direction:column;align-items:center;justify-content:center;
    gap:12px;min-width:0;
    padding:18px 20px;border-radius:14px;
    background:linear-gradient(180deg,#fffdf8 0%,#fff9ee 100%);
    box-shadow:inset 0 0 0 1.5px #eddfca, 0 2px 0 rgba(255,255,255,.8);
}
.game-sub{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;}
.game-lvname{font-size:11px;font-weight:700;color:var(--ink-mute);letter-spacing:.3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.zh-row{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:10px;max-width:100%;}
.zh-word{
    max-width:min(100%, 560px);
    padding:10px 24px;border-radius:18px;background:var(--cream);
    box-shadow:0 0 0 3px var(--ink), 0 6px 0 3px var(--gold);
    font-size:34px;font-weight:900;line-height:1.28;text-align:center;
    overflow-wrap:anywhere;
    transition:transform .2s var(--ease);
}
.zh-word.is-swap{animation:zhSwap .42s var(--ease);}
.btn-say{
    flex:none;width:44px;height:44px;padding:0;border-radius:50%;
    border:0;background:#fff;color:var(--orange);
    box-shadow:0 0 0 2.5px var(--ink), 0 4px 0 2.5px var(--side);
    font-size:17px;line-height:1;
    transition:transform .08s,box-shadow .08s;
}
.btn-say:active{transform:translateY(3px);box-shadow:0 0 0 2.5px var(--ink),0 1px 0 2.5px var(--side);}
.btn-say[disabled]{opacity:.45;}
.game-kind{
    margin:0;min-height:20px;width:100%;text-align:center;
    color:#a8661a;font-size:12.5px;font-weight:700;line-height:1.5;
}
.game-kind:empty{display:none;}

/* 字母格：宽度由 JS 依容器宽度算出，写进 --slot-w，避免单词过长溢出 */
.word-slots{
    display:flex;flex-wrap:nowrap;align-items:center;justify-content:center;
    gap:6px;width:100%;min-height:74px;
    --slot-w:52px; --slot-h:58px; --slot-fs:34px;
}
.slot{
    flex:none;display:inline-flex;align-items:center;justify-content:center;
    width:var(--slot-w);height:var(--slot-h);
    border-radius:10px;background:#fff;
    box-shadow:0 0 0 2.5px var(--ink), 0 5px 0 2.5px var(--side);
    font-family:"Segoe UI",Arial,sans-serif;font-size:var(--slot-fs);font-weight:800;line-height:1;
    transition:background .18s,color .18s,box-shadow .18s;
    will-change:transform;
}
.slot-gap{flex:none;width:calc(var(--slot-w) * .55);}
.slot-mark{
    flex:none;width:calc(var(--slot-w) * .45);min-width:10px;height:var(--slot-h);
    display:inline-flex;align-items:center;justify-content:center;
    color:var(--ink-soft);font-size:calc(var(--slot-fs) * .62);font-weight:800;
    background:transparent;box-shadow:none;
}
.slot.is-given{background:#f2ebdf;color:#8b7a68;}
.slot.is-filled{color:var(--orange);}
.slot.is-typed{color:var(--orange-deep);animation:letterPop .22s var(--ease);}
.slot.is-cur{background:var(--yellow);box-shadow:0 0 0 2.5px var(--orange),0 5px 0 2.5px #e0a83a;animation:curPulse 1.4s ease-in-out infinite;}
.slot.is-bad{background:var(--red);color:#fff;box-shadow:0 0 0 2.5px var(--ink),0 5px 0 2.5px #8e2b22;}
.word-slots.is-ok .slot{background:var(--green-soft);color:var(--green);box-shadow:0 0 0 2.5px #2f7a41,0 5px 0 2.5px #9fd3a8;animation:okFlash .5s var(--ease);}
.word-slots.is-miss{animation:shake .34s;}
.word-slots.is-ok .slot-mark{color:var(--green);}

/* 反馈区：固定高度，避免文案出现/消失造成页面跳动 */
.fb{
    display:flex;align-items:center;justify-content:center;gap:6px;
    width:100%;min-height:26px;margin:0;
    color:var(--ink-soft);font-size:15px;font-weight:700;line-height:1.5;text-align:center;
}
.fb.is-ok{color:var(--green);}
.fb.is-miss{color:var(--red);}
.fb.is-ok,.fb.is-miss{animation:fbIn .28s var(--ease);}
.tip-text{
    display:inline-block;min-height:0;margin:0 auto;padding:3px 12px;border-radius:8px;
    background:var(--cream);color:#a8661a;font-size:13px;font-weight:700;text-align:center;
}
.tip-text:empty{display:none;}

/* ---------- 右侧输入区 ---------- */
.game-pad{
    display:flex;flex-direction:column;justify-content:center;align-self:stretch;gap:12px;
    width:100%;max-width:460px;margin:0 auto;padding:16px 18px;
    border-radius:14px;
    background:rgba(255,253,248,.72);
    box-shadow:inset 0 0 0 1.5px #eddfca;
}
.pad-tag{margin:0;color:#8b7a68;font-size:12px;font-weight:700;text-align:center;letter-spacing:.3px;}
.tile-row{display:flex;flex-wrap:wrap;justify-content:center;align-content:center;gap:10px;min-height:70px;}
.tile{
    position:relative;width:56px;height:60px;padding:0;
    display:inline-flex;align-items:center;justify-content:center;
    border:0;border-radius:12px;background:#fff;
    box-shadow:0 0 0 2.5px var(--ink), 0 6px 0 2.5px var(--side);
    font-family:"Segoe UI",Arial,sans-serif;font-size:29px;font-weight:800;
    color:var(--ink);cursor:pointer;user-select:none;
    -webkit-tap-highlight-color:transparent;touch-action:manipulation;
    transition:transform .07s,box-shadow .07s,opacity .18s,background .18s;
}
.tile.is-cand{background:#f2f7ff;box-shadow:0 0 0 2.5px var(--ink), 0 6px 0 2.5px #b9cde3;}
.tile:hover:not(:disabled){transform:translateY(-1px);}
.tile:active:not(:disabled),.tile.is-press{transform:translateY(5px);box-shadow:0 0 0 2.5px var(--ink), 0 1px 0 2.5px var(--side);}
.tile:disabled{cursor:default;}
.tile.is-used{opacity:.14;}
.tile.is-shake{background:var(--red-soft);animation:shake .3s;}
.tile.is-ok{background:var(--green-soft);box-shadow:0 0 0 2.5px #2f7a41, 0 6px 0 2.5px #9fd3a8;animation:letterPop .22s var(--ease);}
/* 屏幕键盘 */
.kb{display:flex;flex-direction:column;gap:6px;width:100%;}
.kb-row{display:flex;justify-content:center;gap:5px;}
.kb-key{
    flex:1 1 0;max-width:44px;min-width:0;height:48px;padding:0;border:0;border-radius:8px;
    background:#fff;color:var(--ink);
    box-shadow:0 0 0 2px var(--ink), 0 4px 0 2px var(--side);
    font-family:"Segoe UI",Arial,sans-serif;font-size:19px;font-weight:800;
    cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;
    transition:transform .06s,box-shadow .06s,background .15s;
}
.kb-key:active:not(:disabled),.kb-key.is-press{transform:translateY(4px);box-shadow:0 0 0 2px var(--ink), 0 1px 0 2px var(--side);}
.kb-key.is-wide{flex:1.9 1 0;max-width:78px;font-family:inherit;font-size:13px;font-weight:800;}
.kb-key.is-ok{background:var(--orange);color:#fff;box-shadow:0 0 0 2px var(--ink), 0 4px 0 2px var(--orange-deep);}
.kb-key.is-hit{background:var(--cream);}
.kb-key:disabled{opacity:.45;cursor:default;}

/* ==========================================================================
 * 4. 状态条 / 说明 / 词表货架 / 页脚
 * ====================================================================== */
.status-bar{
    width:fit-content;max-width:100%;margin:12px auto 0;padding:6px 18px;
    border-radius:999px;background:var(--cream);
    box-shadow:0 0 0 2px var(--ink), 0 3px 0 2px var(--gold);
    font-size:13px;font-weight:800;text-align:center;cursor:pointer;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
    transition:transform .12s;
}
.status-bar:hover{transform:translateY(-1px);}
.help-box,.shelf-box{
    max-width:1080px;margin:10px auto 0;padding:12px 16px;border-radius:14px;
    background:rgba(255,253,247,.9);box-shadow:0 0 0 2px #e3d6c0;
    font-size:13px;line-height:1.9;color:var(--ink-soft);
}
.help-box kbd{
    display:inline-block;padding:0 6px;border:1px solid #d8c7ab;border-bottom-width:2px;
    border-radius:5px;background:#fffdf7;color:var(--ink);font-family:inherit;font-size:12px;
}
.shelf-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:6px;font-weight:800;color:var(--ink);}
.shelf-head span:last-child{color:var(--ink-mute);font-size:12px;font-weight:600;}
.shelf-group{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin:6px 0;}
.shelf-group>span{color:#8b7a68;font-size:12px;font-weight:800;margin-right:2px;}
.bookchip{
    padding:5px 12px;border:1.5px solid var(--gold);border-radius:999px;background:#fff;
    font:inherit;font-size:13px;font-weight:700;color:var(--ink);cursor:pointer;
    transition:background .15s,transform .12s;
}
.bookchip:hover{background:#fff8e8;transform:translateY(-1px);}
.bookchip.is-on{border-color:var(--ink);background:var(--yellow);}
.game-footer{max-width:1080px;margin:18px auto 0;color:var(--ink-mute);font-size:12px;line-height:1.9;text-align:center;}
.game-footer a{color:var(--ink-soft);text-decoration:underline;}

/* ==========================================================================
 * 5. 说明型内容区（H2 结构、可被搜索引擎读取；默认收起，点「操作说明」展开）
 *    注意：收起用 max-height 而非 display:none，正文仍留在 DOM 里可被抓取
 * ====================================================================== */
.seo-wrap{max-height:0;opacity:0;overflow:hidden;margin:0 auto;pointer-events:none;transition:max-height .42s var(--ease),opacity .28s;}
.seo-wrap.is-open{max-height:2600px;opacity:1;margin-top:16px;pointer-events:auto;}
.seo-section{max-width:1080px;margin:0 auto;display:grid;gap:14px;}
.seo-card{
    padding:18px 20px 20px;border-radius:14px;background:rgba(255,253,247,.92);
    box-shadow:0 0 0 2px #e3d6c0;
}
.seo-card h2{
    display:flex;align-items:center;gap:8px;margin:0 0 10px;
    font-size:17px;font-weight:900;letter-spacing:.4px;color:var(--ink);
}
.seo-card h2 .glyphicon{color:var(--orange);font-size:15px;}
.seo-card p{margin:0 0 8px;color:var(--ink-soft);font-size:13.5px;line-height:1.9;}
.seo-card p:last-child{margin-bottom:0;}
.step-list{
    display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;
    margin:12px 0 0;padding:0;list-style:none;
}
.step-list li{
    padding:12px 14px;border-radius:12px;background:#fff;
    box-shadow:0 0 0 1.5px var(--line);
}
.step-list b{display:block;margin-bottom:4px;font-size:13.5px;color:var(--ink);}
.step-list span{font-size:12.5px;color:var(--ink-soft);line-height:1.7;}
.step-list em{
    display:inline-flex;align-items:center;justify-content:center;
    width:22px;height:22px;margin-right:6px;border-radius:50%;
    background:var(--orange);color:#fff;font-style:normal;font-size:12px;font-weight:900;
}
.type-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:10px;}
.type-grid article{padding:12px 14px;border-radius:12px;background:#fff;box-shadow:0 0 0 1.5px var(--line);}
.type-grid h3{margin:0 0 5px;font-size:13.5px;font-weight:900;color:var(--ink);}
.type-grid p{margin:0;font-size:12.5px;color:var(--ink-soft);line-height:1.75;}
.faq-list{display:grid;gap:8px;margin-top:6px;}
.faq-list details{
    border-radius:10px;background:#fff;box-shadow:0 0 0 1.5px var(--line);overflow:hidden;
}
.faq-list summary{
    padding:10px 14px;cursor:pointer;font-size:13.5px;font-weight:800;color:var(--ink);
    list-style:none;
}
.faq-list summary::-webkit-details-marker{display:none;}
.faq-list summary::before{content:"Q";display:inline-block;width:20px;height:20px;margin-right:8px;border-radius:50%;background:var(--orange);color:#fff;font-size:11px;font-weight:900;line-height:20px;text-align:center;}
.faq-list details[open] summary{background:var(--cream);}
.faq-list p{margin:0;padding:10px 14px 12px 42px;font-size:13px;color:var(--ink-soft);line-height:1.9;}

/* ==========================================================================
 * 6. 弹层（Bootstrap 3 的 modal 结构 + 居中方案）
 * ====================================================================== */
.modal{text-align:center;z-index:1200;}
.modal:before{content:" ";display:inline-block;height:100%;vertical-align:middle;margin-right:-4px;}
.modal-dialog{display:inline-block;text-align:left;vertical-align:middle;max-width:92vw;}
/* 蒙版：默认半透明太浅，改成接近纯黑的深色，让弹层与题面彻底分层 */
.modal-backdrop{background:#0c0806;}
.modal-backdrop.in{opacity:.78;}

.modal-content{
    border-radius:16px;border:2px solid #3a2f28;
    background:var(--paper);
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.55), 0 10px 0 rgba(43,36,32,.28), 0 22px 40px rgba(0,0,0,.28);
}
.modal-header,.modal-footer{border-color:#e8dcc8;}
/* 设置弹层的三个操作按钮保持一行（Bootstrap 默认会换行，这里用 flex 锁住） */
.modal-footer.footer-inline{display:flex;flex-wrap:nowrap;justify-content:center;gap:8px;}
.modal-footer.footer-inline .btn{white-space:nowrap;padding:7px 12px;}
.modal-title{font-weight:900;font-size:16px;}
.modal-body{text-align:center;}
.modal-footer{text-align:center;}
.dialog-title{margin:4px 0 10px;font-size:25px;font-weight:900;letter-spacing:.8px;line-height:1.35;text-align:center;}
.dialog-sub{margin:0;color:var(--ink-soft);font-size:14px;line-height:1.9;text-align:center;}
.dialog-sub b{color:var(--ink);}
.dialog-btns{display:flex;flex-wrap:nowrap;justify-content:center;gap:8px;margin-top:16px;}
.dialog-btns .btn{border-radius:10px;font-weight:800;min-width:0;padding:10px 16px;white-space:nowrap;}
/* 大星星 */
.big-stars{display:flex;justify-content:center;gap:12px;margin:10px 0 12px;font-size:52px;line-height:1;}
.big-stars .star{color:#e6dbca;transform:scale(.9);}
.big-stars .star.is-on{color:#f2b632;text-shadow:0 3px 0 #a8661a;animation:starPop .5s var(--ease) both;}
.big-stars .star:nth-child(2).is-on{animation-delay:.14s;}
.big-stars .star:nth-child(3).is-on{animation-delay:.28s;}
.modal-content.is-win{animation:winPop .5s var(--ease) both;}
.modal-content.is-fail{animation:failDrop .55s var(--ease) both;}
.score-line{
    display:flex;align-items:center;justify-content:center;gap:7px;margin:5px 0;
    font-size:14px;font-weight:700;color:var(--ink);
}
.score-line .glyphicon{color:var(--orange);}
/* 设置表单 */
.set-row{
    display:flex;align-items:center;justify-content:space-between;gap:12px;
    padding:8px 2px;border-bottom:1px dashed var(--line);text-align:left;
}
.set-row:last-child{border-bottom:0;}
.set-row label{margin:0;font-size:13.5px;font-weight:700;color:var(--ink);cursor:pointer;}
.set-row label .glyphicon{color:var(--orange);margin-right:4px;}
.set-row .sel,.set-row input[type="text"]{
    min-height:34px;max-width:56%;padding:4px 8px;border:2px solid var(--side);
    border-radius:8px;background:#fff;color:var(--ink);font-size:13px;font-weight:700;
}
.set-row input[type="checkbox"]{width:18px;height:18px;accent-color:var(--orange);cursor:pointer;}
/* 规则列表 */
.rules-list{
    max-width:480px;margin:0 auto;padding:0;list-style:none;
    font-size:13.5px;line-height:2;text-align:left;
}
.rules-list li{display:flex;gap:8px;align-items:flex-start;}
.rules-list .glyphicon{color:var(--orange);flex:none;margin-top:5px;}
/* 单词本 */
.wb-read{min-height:28px;margin:0 0 8px;color:var(--orange);font-size:19px;font-weight:800;text-align:center;}
.wb-head{margin:10px 0px;color:#8b7a68;font-size:1.5em;font-weight:800;text-align:left;border-bottom:1px solid var(--orange);}
.wb-chips{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:6px;}
.wb-chip{
    position:relative;display:inline-flex;align-items:baseline;gap:6px;
    padding:4px 10px;border:1.5px solid var(--gold);border-radius:8px;background:#fff;
    font:inherit;font-size:13.5px;color:var(--ink);cursor:pointer;
}
.wb-chip:hover{background:#fffaf0;}
.wb-chip .w{font-family:"Segoe UI",Arial,sans-serif;font-size:16px;font-weight:800;}
.wb-chip .zh{color:var(--ink-soft);font-size:12px;}
.wb-chip.is-know{border-color:#8cc58f;background:var(--green-soft);}
.wb-chip.is-know .w::after{content:" ✓";color:var(--green);}
.wb-chip.is-miss::after{
    content:"";position:absolute;top:3px;right:3px;width:7px;height:7px;
    border-radius:50%;background:#e0533d;box-shadow:0 0 0 1.5px #fff;
}
/* 选关 */
.level-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;}.lvbtn{
                                                                                    display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px 4px;
                                                                                    border:0;border-radius:10px;background:#fff;
                                                                                    box-shadow:0 0 0 2px var(--ink), 0 3px 0 2px var(--side);
                                                                                    font-size:13px;font-weight:800;color:var(--ink);cursor:pointer;
                                                                                }
.lvbtn small{min-height:14px;color:#f2b632;font-size:11px;letter-spacing:1px;}
.lvbtn.is-cur{background:var(--yellow);box-shadow:0 0 0 2px var(--orange), 0 3px 0 2px #e0a83a;}
.lvbtn.is-pick{background:var(--cream);box-shadow:0 0 0 2px var(--orange), 0 3px 0 2px #e0a83a;}

/* 词表 / 关卡切换器（标题右侧入口） */
.picker-tip{margin:0 0 10px;font-size:13px;line-height:1.8;text-align:center;color:var(--ink-soft);}
.book-tabs{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:2px 0 14px;}
.book-tab{
    padding:6px 14px;border:1.5px solid var(--gold);border-radius:999px;background:#fff;
    font:inherit;font-size:13px;font-weight:800;color:var(--ink);cursor:pointer;
    transition:background .15s,box-shadow .15s,transform .12s;
}
.book-tab:hover{background:#fff8e8;transform:translateY(-1px);}
.book-tab.is-on{background:var(--yellow);border-color:var(--orange-deep);box-shadow:0 0 0 2px rgba(239,106,53,.22);}
.picker-meta{margin:10px 0 0;font-size:12px;line-height:1.8;text-align:center;color:var(--ink-mute);}
/* 总静音态：喇叭变灰，和「有声音」一眼区分 */
.btn.is-muted{color:#b3a292;border-color:#d9cbba;background:#f6efe5;}
/* 单词本点击反馈：短暂高亮，配合朗读让点击有回应 */
.wb-chip.is-read{background:var(--cream);box-shadow:0 0 0 2px var(--orange),0 2px 0 1px #e0a83a;}
/* 排行榜 */
.rank-table{width:100%;border-collapse:collapse;font-size:12.5px;}
.rank-table th,.rank-table td{padding:6px 8px;border-bottom:1px dashed var(--line);text-align:left;}
.rank-table th{color:var(--ink-soft);font-weight:800;}
.rank-table td b{font-variant-numeric:tabular-nums;}
.match-form{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px;margin:8px 0;}
.match-form .sel{min-height:36px;padding:4px 8px;border:2px solid var(--side);border-radius:8px;font-weight:700;}

/* 主按钮统一成主题橙，避免 Bootstrap 默认蓝色与纸感橙色打架 */
.btn-primary{
    background:var(--orange);border-color:var(--orange-deep);color:#fff;
    box-shadow:0 3px 0 rgba(180,71,31,.55);
}
.btn-primary:hover,.btn-primary:focus,.btn-primary:active{
    background:#dd5c27 !important;border-color:var(--orange-deep) !important;color:#fff !important;
}
.btn-success{background:var(--green);border-color:#2f7a41;box-shadow:0 3px 0 rgba(47,122,65,.5);}
.btn-success:hover,.btn-success:focus{background:#368848 !important;border-color:#2f7a41 !important;}

/* ==========================================================================
 * 7. Toast / 特效画布 / 浮动分数
 * ====================================================================== */
.toast-wrap{position:fixed;inset:0;z-index:3600;display:flex;align-items:center;justify-content:center;pointer-events:none;}
.toast{
    max-width:82vw;padding:12px 22px;border-radius:12px;
    background:rgba(43,36,32,.92);color:#fff;font-size:14.5px;font-weight:800;
    text-align:center;box-shadow:0 8px 22px rgba(0,0,0,.3);
    animation:toastIn .24s var(--ease) both;
}
.toast.is-warn{background:rgba(180,71,31,.95);}
#fxCanvas{position:fixed;inset:0;z-index:3800;pointer-events:none;display:none;}
.float-score{
    position:fixed;z-index:3700;pointer-events:none;
    color:var(--orange-deep);font-size:20px;font-weight:900;letter-spacing:1px;
    text-shadow:0 2px 0 #fff,0 0 10px rgba(255,255,255,.9);
    animation:floatUp .9s var(--ease) both;
}

/* ==========================================================================
 * 8. 关键帧
 * ====================================================================== */
@keyframes shake{0%,100%{transform:translateX(0);}20%{transform:translateX(-7px);}45%{transform:translateX(6px);}70%{transform:translateX(-4px);}}
@keyframes letterPop{0%{transform:scale(.6);opacity:.4;}60%{transform:scale(1.14);opacity:1;}100%{transform:scale(1);}}
@keyframes okFlash{0%{transform:scale(1);}40%{transform:scale(1.07);}100%{transform:scale(1);}}
@keyframes curPulse{0%,100%{box-shadow:0 0 0 2.5px var(--orange),0 5px 0 2.5px #e0a83a;}50%{box-shadow:0 0 0 2.5px var(--orange),0 5px 0 2.5px #e0a83a,0 0 0 7px rgba(239,106,53,.18);}}
@keyframes zhSwap{0%{transform:translateY(8px) scale(.94);opacity:.3;}100%{transform:none;opacity:1;}}
@keyframes fbIn{0%{transform:translateY(4px);opacity:.5;}100%{transform:none;opacity:1;}}
@keyframes hudPulse{0%{transform:scale(1);}45%{transform:scale(1.08);}100%{transform:scale(1);}}
@keyframes toastIn{from{opacity:0;transform:scale(.86);}to{opacity:1;transform:scale(1);}}
@keyframes floatUp{0%{opacity:0;transform:translate(-50%,6px) scale(.85);}25%{opacity:1;transform:translate(-50%,-8px) scale(1.05);}100%{opacity:0;transform:translate(-50%,-46px) scale(1);}}
@keyframes starPop{0%{opacity:0;transform:scale(.2) rotate(-30deg);}70%{opacity:1;transform:scale(1.18) rotate(4deg);}100%{transform:scale(1) rotate(0);}}
@keyframes winPop{0%{opacity:0;transform:scale(.72);}60%{opacity:1;transform:scale(1.04);}100%{transform:scale(1);}}
@keyframes failDrop{0%{opacity:0;transform:translateY(-36px) rotate(-1.5deg);}60%{opacity:1;transform:translateY(5px) rotate(.8deg);}100%{transform:none;}}
@keyframes fadeUp{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:none;}}

/* 入场：轻微上浮，避免生硬 */
.game-header{animation:fadeUp .45s var(--ease) both;}
.game-stage{animation:fadeUp .55s .08s var(--ease) both;}

/* ==========================================================================
 * 9. 响应式：优先保证「题面 + 输入区」不横向溢出
 * ====================================================================== */
@media (max-width:1080px){
    .game-main{gap:18px;padding:12px 18px 20px;}
    .zh-word{font-size:30px;}
}
@media (max-width:900px){
    .game-stage{min-height:0;}
    .game-main{grid-template-columns:minmax(0,1fr);gap:14px;padding:12px 14px 18px;}
    .game-panel{gap:10px;}
    .zh-word{font-size:27px;padding:8px 18px;}
    .game-pad{max-width:520px;}
    .tile{width:48px;height:52px;font-size:25px;}
    .kb-key{height:44px;max-width:40px;font-size:17px;}
    .step-list,.type-grid{grid-template-columns:minmax(0,1fr);}
}
@media (max-width:560px){
    body.game-page{padding:8px 7px 28px;}
    /* 手机：品牌 / 指标 / 操作分三行，避免六个按钮把页头撑破 */
    .game-header{
        grid-template-columns:minmax(0,1fr);
        grid-template-areas:"brand" "hud" "actions";
        gap:6px;padding:8px 10px;
    }
    .game-brand h1{font-size:15.5px;gap:6px;white-space:normal;}
    .brand-row{flex-wrap:wrap;gap:6px;}
    .brand-switch{max-width:100%;font-size:11px;}
    .dialog-btns{flex-wrap:wrap;}
    .modal-footer.footer-inline{flex-wrap:wrap;}
    .game-brand h1 .brand-kicker{font-size:10px;}
    .game-brand p{font-size:10.5px;}
    .hud{gap:5px;}
    .hud-item{min-height:32px;padding:3px 5px;font-size:11.5px;border-radius:8px;}
    .hud-label{display:none;}
    .hud-item>.glyphicon{font-size:11px;}
    .hud-actions{justify-content:flex-start;flex-wrap:wrap;gap:4px;}
    .hud-actions .btn{padding:5px 7px;font-size:11px;}
    .hud-actions .btn .glyphicon{font-size:11px;}
    .stage-top{padding:8px 10px 0;}
    .stage-top .lv-name{max-width:42%;font-size:11.5px;}
    .zh-word{font-size:23px;padding:7px 14px;border-radius:14px;}
    .btn-say{width:38px;height:38px;font-size:15px;}
    .game-kind{font-size:11.5px;}
    .fb{font-size:13.5px;}
    .tile{width:44px;height:48px;font-size:23px;border-radius:10px;}
    .tile-row{gap:8px;}
    .kb-key{height:40px;font-size:16px;}
    .dialog-title{font-size:20px;}
    .big-stars{font-size:40px;}
    .level-grid,#pickLevels{grid-template-columns:repeat(4,minmax(0,1fr));}
    .seo-card{padding:14px 14px 16px;}
    .seo-card h2{font-size:15.5px;}
}
@media (max-width:380px){
    .hud-item b{font-size:11px;}
    .tile{width:40px;height:44px;font-size:21px;}
    .kb-key{height:38px;font-size:15px;}
}

/* 全屏练习：直接把根元素全屏，弹层 / 撒花 / Toast 都在同一坐标系里，
   不再需要搬动 DOM（原实现把弹层搬进舞台，会导致遮罩丢失） */
body.is-fs{padding:0;overflow:hidden;background:var(--paper);}
body.is-fs .game-shell{
    height:100vh;max-width:none;display:flex;flex-direction:column;justify-content:center;
    padding:1.6vh 2vw;
}
body.is-fs .game-footer,
body.is-fs .seo-wrap,
body.is-fs .seo-section,
body.is-fs .status-bar,
body.is-fs .help-box,
body.is-fs .shelf-box{display:none !important;}
body.is-fs .game-header{max-width:none;}
body.is-fs .game-stage{flex:1 1 auto;max-width:none;min-height:0;}
body.is-fs .game-main{padding:1.4vh 2.4vw;}
body.is-fs .zh-word{font-size:clamp(24px,4.2vmin,44px);}
body.is-fs .game-pad{max-width:min(440px,46vw);}

/* ==========================================================================
 * 10. 打印：默写纸
 * ====================================================================== */
.print-area{display:none;}
@media print{
    body.game-page{padding:0;background:#fff;}
    body.game-page::before{display:none;}
    .game-shell,.toast-wrap,#fxCanvas,.seo-section,.status-bar,
    .modal,.modal-backdrop{display:none !important;}
    .print-area{
        display:block;padding:12mm;color:#000;
        font-family:"PingFang SC","Microsoft YaHei",sans-serif;
    }
    .print-area h2{margin:0 0 2mm;font-size:18pt;font-weight:800;color:#000;}
    .print-meta{margin-bottom:6mm;color:#444;font-size:10pt;}
    .print-grid{display:grid;grid-template-columns:1fr 1fr;gap:4mm 10mm;}
    .print-item{display:flex;align-items:baseline;gap:2mm;padding:1.5mm 0;border-bottom:1px dashed #999;font-size:11pt;}
    .print-num{color:#666;font-size:9pt;}
    .print-zh{flex:1;}
    .print-line{flex:2;border-bottom:1px solid #333;height:5mm;}
}

/* ==========================================================================
 * 11. 无障碍：尊重系统的「减少动态效果」偏好
 * ====================================================================== */
@media (prefers-reduced-motion:reduce){
    *,*::before,*::after{
        animation-duration:.001ms !important;
        animation-iteration-count:1 !important;
        transition-duration:.001ms !important;
        scroll-behavior:auto !important;
    }
}
@media (min-width: 768px) {
    .modal-dialog {
        min-width: auto;
        width: auto;
    }
}