  /* ================= v125 信息分层 ================= */
  .prepmeta{display:flex;align-items:center;gap:7px;justify-content:center;flex-wrap:wrap;
    margin:0 0 10px;font-size:10.5px;color:#8ba0bd;letter-spacing:.03em;}
  .prepmeta .pm-stone b{color:#ffe6b2;font-weight:600;font-variant-numeric:tabular-nums;}
  .prepmeta .pm-sep{color:#4f5f78;}
  .prepmeta .pm-info{color:#7f93ab;}

  .moregrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:12px 0 4px;}
  .moreitem{display:flex;flex-direction:column;align-items:flex-start;gap:3px;
    padding:11px 12px;border-radius:9px;cursor:pointer;font-family:inherit;text-align:left;
    background:linear-gradient(180deg,rgba(26,34,52,.92),rgba(10,15,26,.96));
    border:1px solid rgba(150,185,230,.18);}
  .moreitem:active{border-color:rgba(217,185,121,.5);background:rgba(40,48,36,.9);}
  .moreitem .mi-name{font-size:12px;color:#eaf3ff;letter-spacing:.04em;}
  .moreitem .mi-val{font-size:9px;color:#8fa3bd;font-variant-numeric:tabular-nums;}

  .bmenu{display:flex;flex-direction:column;gap:5px;margin:12px 0 4px;}
  .bmrow{display:flex;align-items:center;justify-content:space-between;gap:10px;
    padding:11px 12px;border-radius:8px;cursor:pointer;font-family:inherit;
    background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);}
  .bmrow:active{background:rgba(255,255,255,.08);}
  .bmrow.on{border-color:rgba(217,185,121,.45);background:rgba(217,185,121,.08);}
  .bmrow .bm-label{font-size:12px;color:#dbe9fb;letter-spacing:.03em;}
  .bmrow .bm-value{font-size:10px;color:#9fb3ca;}
  .bmrow.on .bm-value{color:#ffd98a;}
  #threatBar .tb-auto{color:#8dffb8;border:1px solid rgba(110,230,170,.4);border-radius:3px;
    padding:0 4px;line-height:1.5;}

  @media (orientation:landscape){
    .moregrid{grid-template-columns:repeat(4,minmax(0,1fr));}
    .bmenu{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
  }

  /* ================= v126 详情页分层 ================= */
  .growthsum{display:flex;align-items:center;gap:7px;justify-content:center;flex-wrap:wrap;
    margin:10px 0 8px;font-size:10px;color:#8fa3bd;letter-spacing:.03em;}
  .growthsum .gs-sep{color:#4f5f78;}
  .panel > .btn.growbtn{width:100%;padding:10px 0;font-size:11.5px;letter-spacing:.08em;
    border-style:dashed;border-color:rgba(150,190,240,.3);}

  /* ================= v127 成就墙 ================= */
  .achgrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:2px 0 10px;}
  .achcard{display:flex;flex-direction:column;align-items:center;gap:5px;
    padding:10px 4px 8px;border-radius:9px;cursor:pointer;font-family:inherit;
    background:linear-gradient(180deg,rgba(22,28,44,.9),rgba(10,14,24,.95));
    border:1px solid rgba(255,255,255,.07);}
  .achcard:active{background:rgba(255,255,255,.06);}
  .achcard .achmedal{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;
    justify-content:center;border:1px solid rgba(255,255,255,.14);
    background:radial-gradient(circle at 50% 35%,rgba(255,255,255,.06),rgba(0,0,0,.4));
    color:#5f6f86;font-size:14px;font-weight:700;}
  .achcard .achname{font-size:8.5px;line-height:1.3;color:#8fa3bd;text-align:center;
    letter-spacing:.02em;max-width:100%;overflow:hidden;
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;}
  .achcard .achmini{width:78%;height:3px;border-radius:2px;background:rgba(255,255,255,.10);overflow:hidden;}
  .achcard .achmini i{display:block;height:100%;background:var(--ac,#9fd0ff);opacity:.55;}
  .achcard.on{border-color:rgba(217,185,121,.55);
    background:linear-gradient(180deg,rgba(44,38,24,.95),rgba(16,13,8,.97));
    box-shadow:0 0 14px rgba(217,185,121,.14);}
  .achcard.on .achmedal{color:#2a1a04;border-color:rgba(255,230,170,.8);
    background:linear-gradient(180deg,#ffe9b0,#d8a444);
    box-shadow:0 0 14px rgba(255,200,110,.55);}
  .achcard.on .achname{color:#f0d9a8;font-weight:600;}
  .achcard.on .achmini i{background:linear-gradient(90deg,#d8a444,#ffe9b0);opacity:1;}
  @media (min-width:520px){.achgrid{grid-template-columns:repeat(4,minmax(0,1fr));}}

  /* ================= v128 固定战斗布局 ================= */
  /* 队伍卡：固定高度，状态行与指令条始终占位 */
  #party{grid-auto-rows:1fr;align-items:stretch;}
  #party .card{min-height:92px;padding-bottom:18px;}
  #party .card.hasord{padding-bottom:18px;}
  #party .card .st{min-height:14px;}
  #party .card .ord{bottom:4px;}
  /* 威胁条常驻，未在指令阶段时淡出但保留高度 */
  #threatBar{height:19px;min-height:19px;max-height:19px;overflow:hidden;}
  #threatBar.quiet{opacity:.38;}
  #threatBar.quiet .tb-lab{color:#5f6f86;}
  /* 指令区固定高度，内部滚动 */
  #cmdSlot{overflow:hidden;}

  /* ================= v129 战斗界面完全固定 ================= */
  /* 顶栏固定高度 */
  #topbar{min-height:30px;height:30px;padding-top:calc(env(safe-area-inset-top,0px) + 6px);
    padding-bottom:0;align-items:center;}

  /* 敌人卡片：从名字到标签全部固定高度，任何状态都不改变位置 */
  #enemyZone{padding:0 6px;align-items:center;}
  #enemyList{height:100%;align-items:flex-end;justify-content:center;gap:6px;}
  .foe{flex:0 1 150px;max-width:150px;height:100%;justify-content:flex-end;gap:2px;}
  .foe[data-n="1"], .foe[data-n="2"], .foe[data-n="3"]{max-width:150px;}
  .foe .fname{height:16px;line-height:16px;overflow:hidden;white-space:nowrap;
    text-overflow:ellipsis;max-width:100%;}
  /* 护盾条改成“占位但不可见”，出现时不推动下方的血条与立绘 */
  .foe .fsh{display:block !important;height:15px;overflow:hidden;margin-bottom:0;}
  .foe .fsh.hide{visibility:hidden;}
  .foe .fhp{height:10px;flex:0 0 auto;}
  .foe .fimg{height:150px;width:100%;object-fit:contain;object-position:center bottom;
    max-width:100%;margin:0;}
  .foe .ftags{height:27px;min-height:27px;overflow:hidden;align-content:flex-start;
    flex:0 0 auto;}
  .foe .fthreat{height:15px;line-height:15px;overflow:hidden;flex:0 0 auto;}

  /* 指令区：固定头部高度 + 固定两行按钮网格，多出的内部滚动 */
  #cmd .cmdhead{min-height:34px;box-sizing:border-box;}
  #cmd .cmdgrid{grid-auto-rows:46px;height:98px;overflow-y:auto;overscroll-behavior:contain;}
  #cmd .cmdgrid::-webkit-scrollbar{width:0;}
  #cmd .cmdbtn{min-height:42px;height:46px;}
  #cmd .planline{height:26px;min-height:26px;overflow:hidden;}
  #cmdSlot{height:clamp(170px,32vh,210px);}

  /* 队伍卡内部行高固定 */
  #party .card .nm{height:18px;align-items:center;overflow:hidden;}
  #party .card .job{height:12px;line-height:12px;}
  #party .bars{height:23px;}

  /* ================= v130 图鉴详情 + 结算固定 ================= */
  .codexrow .codexarrow{margin-left:auto;flex:0 0 auto;color:#5f6f86;font-size:13px;padding-left:6px;}
  .codexrow:active{background:rgba(255,255,255,.06);}
  #gear .mdpic{display:block;margin:8px auto 6px;width:112px;height:112px;object-fit:contain;
    image-rendering:pixelated;filter:drop-shadow(0 10px 20px rgba(0,0,0,.6));}
  #gear .mdgrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:6px 0 8px;}
  #gear .mdgrid .statcell{flex-direction:column;align-items:center;gap:1px;padding:6px 2px;}
  #gear .mdgrid .statcell .sk{font-size:8px;}
  #gear .mdgrid .statcell .sv{font-size:13px;}
  .mdtags{display:flex;gap:6px;justify-content:center;flex-wrap:wrap;margin:0 0 6px;}
  .mdchip{font-size:9px;padding:2px 8px;border-radius:5px;color:#a8b9cd;
    border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.04);}
  .mdchip.weak{border-color:currentColor;background:rgba(0,0,0,.25);}
  .mdacts{display:flex;flex-direction:column;gap:4px;margin:4px 0 6px;}
  .mdact{display:flex;justify-content:space-between;gap:8px;font-size:10px;
    padding:6px 9px;border-radius:6px;background:rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.06);}
  .mdact .mdn{color:#dbe9fb;}
  .mdact .mdd{color:#8fa3bd;font-variant-numeric:tabular-nums;}
  /* 结算：战利品区固定高度，超出滚动 */
  .clist.clist-fixed{height:auto;max-height:42vh;overflow-y:auto;gap:5px;
    justify-content:flex-start;padding-bottom:2px;}
  .clist.clist-fixed.hasmore{
    -webkit-mask-image:linear-gradient(180deg,#000 84%,rgba(0,0,0,.15) 100%);
    mask-image:linear-gradient(180deg,#000 84%,rgba(0,0,0,.15) 100%);}
  .clist.clist-fixed::-webkit-scrollbar{width:0;}
  .clist.clist-fixed .crow{min-height:30px;flex:0 0 auto;}

  /* ================= v131 技能名提示 + 掉落卡固定 ================= */
  #skillToast{position:absolute;left:50%;top:78px;transform:translateX(-50%);z-index:9;
    font-size:15px;font-weight:700;letter-spacing:.14em;white-space:nowrap;
    text-shadow:0 2px 8px rgba(0,0,0,.95),0 0 18px currentColor;
    opacity:0;transition:opacity .18s linear;pointer-events:none;}
  #skillToast.show{opacity:1;}
  @media (orientation:landscape){#skillToast{top:44px;font-size:13px;}}

  /* 掉落卡：高度固定，词缀行始终占位 */
  #drop .dcard{height:116px;align-items:center;}
  #drop .dcard .dmod.affix{height:13px;min-height:13px;overflow:hidden;
    white-space:nowrap;text-overflow:ellipsis;}
  #drop .dcard .txtwrap{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1;}

  /* ================= v132 结算固定 + 滚动记忆 ================= */
  #result .panel{min-height:396px;}
  #result .rw{height:66px;margin:12px 0 10px;}
  #result .rwcell{padding:8px;}
  #result .mvpbar{height:24px;min-height:24px;max-height:24px;overflow:hidden;
    margin:0 0 10px;padding:0 10px;flex-wrap:nowrap;align-items:center;}
  #result .mvpbar .mvp-item{font-size:9px;}
  #result > .panel > .btn{height:46px;padding:0;display:flex;align-items:center;
    justify-content:center;}
  #result > .panel > .btn.ghost{height:38px;}

  /* ================= v133 撤回 + 出没关卡 ================= */
  .cmdhead .cmdhelp.undo{color:#ffd98a;border-color:rgba(217,185,121,.5);font-size:12px;line-height:14px;}
  .mdstages{display:flex;flex-wrap:wrap;gap:5px;margin:6px 0 10px;}
  .mdstage{font-family:inherit;font-size:9.5px;padding:5px 8px;border-radius:6px;cursor:pointer;
    color:#a8b9cd;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.1);}
  .mdstage.clear{color:#8dffb8;border-color:rgba(110,230,170,.35);}
  .mdstage:active{background:rgba(120,180,255,.16);}
  .mdempty{font-size:9px;color:#7f93ab;}


  .mdstage.lock{opacity:.4;}


  .clistmore{width:100%;text-align:center;font-size:9px;color:#7f8ea6;letter-spacing:.04em;
    margin:-6px 0 8px;}
  /* 稀有度光效不应盖在文字上 */
  #drop .dcard > *{position:relative;z-index:1;}
  #drop .dcard.rar-legend::after{z-index:0;}


  /* 掉落卡文字防换行裁切 */
  #drop .dcard .dname{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;}
  #drop .dcard .dmod{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;}
  #drop .dcard .dcmp{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;}

  /* ================= v136 图鉴完成度奖励条 ================= */
  /* 图鉴面板顶部新增「层印章 + 全局里程碑」徽章条：徽章上只显示层名与进度，
     完整说明（印章名 / 还差几种 / 奖励数量）走 toast，避免撑爆窄屏面板。 */
  .codexrw{margin:0 0 10px;}
  .cxbadges{display:flex;flex-wrap:wrap;gap:4px;}
  .cxbadge{display:flex;flex-direction:column;align-items:center;gap:1px;flex:1 1 auto;
    min-width:52px;padding:5px 6px;border-radius:7px;cursor:pointer;
    border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.025);
    -webkit-tap-highlight-color:transparent;}
  .cxbadge:active{background:rgba(255,255,255,.06);}
  .cxbadge b{font-size:9px;font-weight:600;letter-spacing:.02em;color:#8fa3bd;}
  .cxbadge i{font-style:normal;font-size:8px;color:#6f8299;}
  .cxbadge.on{border-color:rgba(217,185,121,.5);
    background:linear-gradient(180deg,rgba(216,164,68,.16),rgba(216,164,68,.05));}
  .cxbadge.on b{color:#f0d9a8;}
  .cxbadge.on i{color:#d8bf8a;}
  /* 已盖章的层在层名前补一枚标记，扫一眼就能看出哪几层收齐了 */
  .cxbadge.on b::before{content:'✓ ';color:#e8c874;}
  .cxbadge.global{flex:0 0 auto;}
  .cxbadge.global b{color:#9fd0ff;}
  .cxbadge.global.on b{color:#f0d9a8;}

  /* 成就 / 图鉴奖励飘字。WHY 新增：JS 里一直在用 .achpop，但历史 CSS 从未定义过它，
     弹窗实际是按裸 div 排版、被面板内容挤在页面流里，几乎看不出是「达成提示」。
     这里补成固定位置的浮层，不占用面板布局，也不会和 #eventBar（战斗事件条）重叠。 */
  .achpop{position:fixed;left:50%;top:13%;transform:translateX(-50%);z-index:120;
    max-width:min(84vw, 360px);padding:7px 14px;border-radius:9px;pointer-events:none;
    font-size:10.5px;letter-spacing:.03em;color:#f2e4c2;white-space:nowrap;
    border:1px solid rgba(217,185,121,.42);
    background:linear-gradient(180deg,rgba(38,30,18,.95),rgba(22,18,12,.95));
    box-shadow:0 6px 20px rgba(0,0,0,.45);
    animation:achpopin .28s ease-out;}
  .achpop b{color:#ffd98a;font-weight:700;margin-right:4px;}
  @keyframes achpopin{from{opacity:0;transform:translate(-50%,-8px);}
    to{opacity:1;transform:translate(-50%,0);}}

  /* ================= v135 手机横屏战斗分栏 ================= */
  /* WHY: 竖屏那套固定高度（立绘 150px + 指令区 170px + 队伍卡 92px）在 844×390 这类横屏视口下
     会把 #stage 挤到 66px，而敌人整列约 226px 高且靠 justify-content:flex-end 对齐，
     于是立绘渲染到舞台上方 133px 处、被 #battle/#enemyZone 的 overflow:hidden 裁掉——
     横屏时玩家根本看不见怪物。矮视口改为左右分栏：舞台吃满剩余高度，HUD 收进右栏。
     命中条件为「横屏 且 视口高度 ≤ 560px」，手机横屏与分屏小窗都能命中，
     正常竖屏手机（≥ 640px 高）与桌面上下布局不受影响。 */
  @media (orientation:landscape) and (max-height:560px){
    #battle{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,36%);
      grid-template-rows:auto minmax(0,1fr);
      grid-template-areas:"top top" "stage hud";}
    #topbar{grid-area:top;}
    #stage{grid-area:stage;min-height:0;}
    #hud{grid-area:hud;justify-content:flex-start;gap:6px;
      padding:0 8px calc(env(safe-area-inset-bottom,0px) + 6px);
      padding-right:calc(env(safe-area-inset-right,0px) + 8px);}
    #battle #party{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;}
    /* 队伍卡：状态行从「与 meta 并排」改为「换行到 meta 下方」。
       卡片只有 ~140px 宽，状态行留在行内时 2~3 个状态标签会把血条挤到 0 宽（实测 bar:0），
       所以这里放开 flex-wrap 让 .st 独占一行，并隐藏职业行——职业已由姓名旁的角色徽章显示，
       省下的 12px 正好补状态行，卡片高度仍是 78px，不会挤压下方指令区。 */
    #battle #party .card{min-height:78px;padding:5px 6px 14px;flex-wrap:wrap;row-gap:2px;}
    #battle #party .bars{height:21px;}
    #battle #party .card .job{display:none;}
    #battle #party .card .por{width:28px;height:28px;}
    #battle #party .card .st{flex:1 0 100%;max-width:none;min-height:12px;
      margin-top:0;justify-content:flex-start;align-content:flex-start;}
    /* 条内 HP/MP 标签去掉：颜色与上下行已足够区分 HP/MP，否则数字压在标签上 */
    #battle #party .btag{display:none;}
    #battle #party .bnum{min-width:0;font-size:8px;}
    #battle #party .stchip{font-size:7.5px;padding:0 2px;}
    #battle #threatBar{margin-bottom:0;}
    /* 指令区吃满右栏剩余高度：固定 clamp 会在 390px 高的横屏里放不下最坏情况的 6 个指令
       （攻击 + 3 技能 + 极限技 + 防御，白魔法师塞拉满能量时就是 6 个 = 2 列 3 行），
       一旦放不下玩家就要滚动才能点到大招。
       按最坏情况反推：3×32 + 2×3 行距 + 表头 26+3 + 连锁行 16+3 + 内边距 4+2 = 150px，
       落进实测 156px 的指令槽；32px 是按钮两行文字（16+2+12）不被裁掉的最小高度。
       指令少于 4 个时面板底部留白，不随角色跳动。 */
    #battle #cmdSlot{height:auto;flex:1 1 auto;min-height:0;}
    #battle #cmd{margin-top:0;padding:4px 6px 2px;}
    #battle #cmd .cmdhead{min-height:26px;margin-bottom:3px;padding-bottom:2px;}
    #battle #cmd .cmdgrid{grid-template-columns:repeat(2,minmax(0,1fr));
      grid-auto-rows:32px;height:auto;gap:3px;}
    #battle #cmd .cmdbtn{min-height:32px;height:32px;padding:1px 7px;}
    #battle #cmd .cmdbtn b{font-size:11.5px;}
    #battle #cmd .cmdbtn span{font-size:8.5px;}
    #battle #cmd .planline{height:16px;min-height:16px;margin-top:3px;padding:1px 4px;}
    #battle #eventBar{max-width:80%;}
  }

  /* ================= v138 整备轮（第四章成长节奏） ================= */
  /* WHY：第四章原本 25-32 关 buff 连爬却没有发放节奏，用「整备轮」把成长补回来：
     多给一个掉落选择 + 标记品质加成，让玩家看得见这一关不一样。 */
  #drop .rsub.boost{color:#f0d9a8;}
  #drop .dcard .dmode{position:relative;}
  #drop .dqboost{display:inline-block;margin-left:6px;padding:0 5px;border-radius:4px;
    font-size:8px;letter-spacing:.02em;color:#f0d9a8;
    border:1px solid rgba(217,185,121,.42);
    background:linear-gradient(180deg,rgba(216,164,68,.18),rgba(216,164,68,.06));}
