/* 行囊（M 号册页）——沿用 760×366 固定设计尺寸：左边行囊格 + 快捷栏，右边装备 / 物品详情；小屏整张等比缩小，不滚动、不截断。
   DOM 沿用原来的 inv-wrap / inv-left / inv-right，拖动、整理、丢弃等操作的脚本一行没动，这里只管排版与皮肤。 */
#panel .pbox.bg29box .k29-bd { overflow: hidden; }
#panel .pbox.bg29box .bg29 { position: relative; height: 100%; box-sizing: border-box; padding: 6px 7px 4px; overflow: hidden; border: 10px solid transparent; border-image: url(../../assets/v29/ui/ui_well.png) 12 fill stretch; image-rendering: pixelated; }
.bg29::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: url(../../assets/ui/ink/ink_hills.webp) center bottom / 100% auto no-repeat; opacity: .35; pointer-events: none; z-index: 0; }
#panel .bg29 .mn-body { max-height: none !important; position: relative; z-index: 1; height: 100%; padding: 0; margin: 0; overflow: hidden; display: block; image-rendering: auto; }
#panel .bg29 .inv-wrap { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 12px; height: 100%; width: 100%; max-height: none; min-height: 0; align-items: stretch; }

/* 左：行囊格 + 快捷栏 */
#panel .bg29 .inv-left { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; touch-action: none; }
#panel .bg29 .inv-cap { flex: none; display: flex; align-items: baseline; gap: 8px; height: 20px; margin: 0 0 3px; line-height: 20px; min-width: 0; }
#panel .bg29 .inv-cap span { font-size: 15px; letter-spacing: 3px; color: var(--ink); font-family: "猫田楷", serif; flex: none; }
#panel .bg29 .inv-cap small { font-size: 11px; letter-spacing: 0; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#panel .bg29 .inv-cap:first-child small { max-width: 190px; }
#panel .bg29 .inv-cap.hot { margin: 7px 0 3px; padding-top: 5px; border-top: 1px dashed rgba(107,90,66,.5); height: 22px; }
#panel .bg29 .sortrow26 { position: absolute; right: 0; top: 0; margin: 0; z-index: 2; }
#panel .bg29 .sortrow26 small { display: none; }
#panel .bg29 .sort26 { height: 20px; padding: 0 10px; font: 12px/18px 'Noto Sans SC', sans-serif; color: var(--ink); cursor: pointer; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-hi); }
#panel .bg29 .sort26:active { background: var(--paper-lo); }
#panel .bg29 .ad-slot { position: absolute; right: 76px; top: 0; width: auto; height: 20px; aspect-ratio: auto; flex-direction: row; gap: 4px; padding: 0 8px; border-width: 1px; border-radius: 6px; z-index: 2; cursor: pointer; }
#panel .bg29 .ad-slot b { font-size: 12px; font-family: inherit; font-weight: 700; letter-spacing: 0; }
#panel .bg29 .ad-slot small { font-size: 11px; letter-spacing: 0; }
#panel .bg29 { --cell: 44px; --cols: 8; }
#panel .bg29 .grid.inv { display: grid; grid-template-columns: repeat(8, 44px) !important; grid-auto-rows: 44px; gap: 4px !important; flex: none; }
#panel .bg29 .grid.inv.hot { margin-top: 0; }

/* 一格：墨线边框 → 图标（统一视觉大小）→ 右下数量 → 底部耐久细条 */
#panel .bg29 .grid.inv .islot, #panel .bg29 .islot { position: relative; box-sizing: border-box; width: 44px !important; height: 44px !important; min-width: 0; aspect-ratio: auto !important; display: grid; place-items: center; padding: 0; margin: 0;
  border: 6px solid transparent; border-image: url(../../assets/v29/ui/ui_cell_idle.png) 12 fill stretch; background: none; box-shadow: none; outline: 0; image-rendering: pixelated; cursor: pointer; filter: drop-shadow(0 1px 0 rgba(42,32,24,.22)); overflow: visible; opacity: 1; }
#panel .bg29 .grid.inv .islot.picked, #panel .bg29 .islot.picked, #panel .bg29 .eq-slot.picked .islot { border-image-source: url(../../assets/v29/ui/ui_cell_on.png); box-shadow: none; background: none; outline: 0; }
#panel .bg29 .islot.picked::after { display: none; }
#panel .bg29 .islot:not(.empty):hover { background: none; }
#panel .bg29 .grid.inv .islot.empty, #panel .bg29 .islot.empty { border: 2px dashed rgba(122,98,64,.35); border-radius: 9px; border-image: none; filter: none; cursor: default; opacity: 1; background: none; }
#panel .bg29 .islot.cur::before { left: -2px; top: -2px; border-top-color: var(--cinnabar, #a8392b); }
#panel .bg29 .islot.drop { outline: 2px dashed var(--cinnabar, #a8392b); outline-offset: -3px; }
#panel .bg29 .grid.inv .islot .ico, #panel .bg29 .islot .ico { --s: 30px !important; pointer-events: none; }
.bg29-ic { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.bg29-ic .gd29-cv { width: 100%; height: 100%; display: block; }
#panel .bg29 .islot.lifting .bg29-ic { opacity: .25; }
#panel .bg29 .islot em { right: 1px; bottom: -1px; font-size: 11px; font-weight: 700; color: var(--ink); text-shadow: 0 0 2px var(--paper-hi), 0 0 2px var(--paper-hi), 0 1px 0 var(--paper-hi); pointer-events: none; }
#panel .bg29 .islot .dur { left: 5px; right: 5px; bottom: 2px; height: 3px; }
#panel .bg29 .islot .hk { left: 1px; top: -2px; font-size: 9px; color: var(--ink-3); font-weight: 700; pointer-events: none; }

/* 右：装备条 + 详情（固定几块：头 / 用途 / 属性 / 按钮） */
#panel .bg29 .inv-right { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; padding: 0 2px; margin: 0; background: none; border: 0; gap: 4px; }
#panel .bg29 .eq-box { flex: none; display: flex; align-items: center; gap: 8px; height: 44px; margin: 0; padding: 0 0 4px; border-bottom: 1px dashed rgba(107,90,66,.5); }
#panel .bg29 .eq-box .inv-cap { height: auto; margin: 0; flex: none; }
#panel .bg29 .eq-box .inv-cap small { display: none; }
#panel .bg29 .eq-row { display: flex; gap: 10px; flex: 1; min-width: 0; }
#panel .bg29 .eq-slot { display: flex; flex-direction: row; align-items: center; gap: 5px; flex: 1; min-width: 0; cursor: pointer; }
#panel .bg29 .eq-slot .islot { flex: none; width: 38px !important; height: 38px !important; pointer-events: none; }
#panel .bg29 .eq-slot .islot .ico { --s: 24px; }
#panel .bg29 .eq-slot .islot .bg29-ic { width: 24px; height: 24px; }
#panel .bg29 .eq-slot span { font-size: 12px; letter-spacing: 1px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel .bg29 .eq-slot.empty span { opacity: .7; }
#panel .bg29 .eq-live { flex: none; margin: 0; padding: 5px 8px; border: 1px solid var(--paper-edge); border-radius: 6px; background: rgba(251,246,230,.55); }
#panel .bg29 .eq-live-title { font-size: 14px; letter-spacing: 3px; font-family: "猫田楷", serif; color: var(--ink); border-bottom: 1px dotted var(--paper-edge); padding-bottom: 2px; margin-bottom: 3px; }
#panel .bg29 .eq-live-title small { font-size: 11px; color: var(--ink-3); letter-spacing: 1px; font-family: inherit; }
#panel .bg29 .eq-live-grid { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; font-size: 12px; line-height: 16px; }
#panel .bg29 .eq-live-grid span { color: var(--ink-3); } #panel .bg29 .eq-live-grid b { color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel .bg29 .inv-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink-2); font-size: 12.5px; }
#panel .bg29 .inv-empty .inv-hand { width: 34px; height: 34px; margin: 0 0 2px; opacity: .55; }
#panel .bg29 .inv-empty p { margin: 2px 0; line-height: 17px; } #panel .bg29 .inv-empty .dim { display: block; font-size: 11.5px; color: var(--ink-3); }
#panel .bg29 .inv-card { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 4px; padding: 0; margin: 0; background: none; border: 0; overflow: hidden; }
#panel .bg29 .ic-top { flex: none; display: flex; align-items: center; gap: 8px; height: 40px; margin: 0; position: relative; }
#panel .bg29 .ic-top::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 70px; background: url(../../assets/ui/ink/ink_bamboo.webp) right center / contain no-repeat; opacity: .8; pointer-events: none; }
#panel .bg29 .ic-big { flex: none; width: 40px; height: 40px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0; border: 7px solid transparent; border-image: url(../../assets/v29/ui/ui_well.png) 12 fill stretch; background: none; image-rendering: pixelated; }
#panel .bg29 .ic-big .ico { --s: 24px; } #panel .bg29 .ic-big .gd29-cv { width: 24px; height: 24px; }
#panel .bg29 .ic-name { font-size: 19px; letter-spacing: 3px; font-family: "猫田楷", serif; font-weight: 400; white-space: nowrap; line-height: 1.1; max-width: 190px; overflow: hidden; }
#panel .bg29 .ic-tag { font-size: 11px; color: var(--ink-3); letter-spacing: 1px; margin-top: 2px; white-space: normal; overflow-wrap: anywhere; }
#panel .bg29 .bg29-desc { flex: 1 1 0; min-height: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
#panel .bg29 .bg29-desc small { flex: none; align-self: stretch; display: flex; align-items: center; justify-content: center; padding-right: 5px; border-right: 1px solid var(--paper-edge); writing-mode: vertical-rl; letter-spacing: 3px; font-size: 11px; color: var(--ink-3); }
#panel .bg29 .ic-desc { margin: 0; font-size: 12px; line-height: 17px; max-height: 51px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#panel .bg29 .bg29-chips { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: 34px; border-top: 1px solid var(--paper-edge); border-bottom: 1px solid var(--paper-edge); }
#panel .bg29 .bg29-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 0 3px; }
#panel .bg29 .bg29-chip + .bg29-chip { border-left: 1px solid var(--paper-edge); }
#panel .bg29 .bg29-chip small { font-size: 11px; color: var(--ink-3); letter-spacing: 2px; line-height: 13px; white-space: nowrap; }
#panel .bg29 .bg29-chip b { font-size: 14px; font-weight: 700; line-height: 17px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
#panel .bg29 .bg29-chip.off { opacity: .45; }
#panel .bg29 .ic-acts { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, 22px); gap: 4px; height: 48px; margin: 0; padding: 0; box-sizing: border-box; align-content: start; }
#panel .bg29 .ic-acts button { height: 22px; padding: 0; font: 12px/1 'Noto Sans SC', sans-serif; color: var(--ink); cursor: pointer; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-hi); white-space: nowrap; overflow: hidden; }
#panel .bg29 .ic-acts button:active { background: var(--paper-lo); }
#panel .bg29 .ic-acts button.pri { color: #fbf6e6; border-color: #1b2523; background: linear-gradient(#3d4e4a, #27342f); }
#panel .bg29 .ic-acts button.drop181 { color: #7a6e58; }
#panel .bg29 .ic-acts button:disabled { opacity: .35; }

/* 屏幕下方的快捷栏格子：与行囊里的格子同一套墨线边框（尺寸、位置、缩放都不动） */

/* ===== 第二版：快捷栏永远钉在下方；行囊格固定三排（多了就左右滑）；右侧「装备与状态条 + 凸起信息板」，不留空 ===== */
#panel .bg29 .grid.inv.main { grid-template-columns: repeat(var(--bgc, 8), 44px) !important; grid-template-rows: repeat(3, 44px); height: 140px; align-content: start; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; touch-action: pan-x; }
#panel .bg29 .grid.inv.hot { margin-top: 0; }
#panel .bg29 .inv-cap.hot { margin-top: auto; }
#panel .bg29 .inv-left { justify-content: flex-start; }
.bg29-ph { box-sizing: border-box; width: 44px; height: 44px; display: grid; place-items: center; border: 2px dashed rgba(122,98,64,.3); border-radius: 9px; font-size: 10px; letter-spacing: 1px; color: rgba(107,90,66,.5); pointer-events: none; background: rgba(214,201,166,.18); }

/* 装备与状态条：两个装备格 + 体力 / 负重两根读数条 */
#panel .bg29 .eq-live { display: none; }
#panel .bg29 .eq-box { height: 40px; padding: 0 6px; gap: 8px; border: 1px solid var(--paper-edge); border-radius: 8px; background: linear-gradient(rgba(233,223,198,.7), rgba(251,246,230,.55)); box-shadow: inset 0 1px 3px rgba(107,90,66,.25); }
#panel .bg29 .eq-box .inv-cap { display: none; }
#panel .bg29 .eq-row { flex: none; gap: 5px; }
#panel .bg29 .eq-slot { flex: none; position: relative; }
#panel .bg29 .eq-slot span { display: none; }
#panel .bg29 .eq-slot .islot { width: 34px !important; height: 34px !important; }
#panel .bg29 .eq-slot .islot .bg29-ic, #panel .bg29 .eq-slot .islot .ico { width: 22px; height: 22px; --s: 22px !important; }
#panel .bg29 .eq-slot.empty .islot::after { content: attr(data-nm); font-size: 11px; color: rgba(107,90,66,.7); letter-spacing: 0; writing-mode: horizontal-tb; }
.bg29-bars { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-left: 8px; border-left: 1px solid var(--paper-edge); }
.bg29-bar { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-3); line-height: 14px; }
.bg29-bar > small { flex: none; width: 24px; letter-spacing: 1px; font-size: 11px; }
.bg29-bar > i { flex: 1; min-width: 0; height: 7px; border-radius: 4px; background: rgba(107,90,66,.2); box-shadow: inset 0 1px 1px rgba(42,32,24,.3); overflow: hidden; }
.bg29-bar > i > u { display: block; height: 100%; border-radius: 4px; background: linear-gradient(#7a9a82, #4f7260); }
.bg29-bar.full > i > u { background: linear-gradient(#c58a5a, #a8603a); }
.bg29-bar > b { flex: none; min-width: 52px; text-align: right; font-size: 12px; color: var(--ink); font-weight: 700; }

/* 信息板：凸起的纸板（与商店右卡同一块底） */
#panel .bg29 .inv-card, #panel .bg29 .inv-empty { flex: 1 1 0; min-height: 0; box-sizing: border-box; padding: 0 3px; gap: 4px; overflow: hidden; border: 9px solid transparent; border-image: url(../../assets/v29/ui/ui_card_raise.png) 12 fill stretch; image-rendering: pixelated; filter: drop-shadow(0 2px 0 rgba(42,32,24,.22)); }
#panel .bg29 .inv-card > *, #panel .bg29 .inv-empty > * { image-rendering: auto; }
#panel .bg29 .ic-top { height: 38px; }
#panel .bg29 .ic-big { width: 38px; height: 38px; border-width: 6px; }
#panel .bg29 .ic-big .ico, #panel .bg29 .ic-big .gd29-cv { --s: 22px; width: 22px; height: 22px; }
#panel .bg29 .ic-name { font-size: 19px; }
#panel .bg29 .bg29-chips { height: 32px; background: rgba(233,223,198,.35); }
#panel .bg29 .bg29-chip b { font-size: 14px; }
#panel .bg29 .bg29-chip:nth-child(1) b { font-size: 17px; }
#panel .bg29 .bg29-chip:nth-child(2) b { color: var(--cinnabar, #a8392b); font-family: "猫田楷", serif; font-weight: 400; letter-spacing: 2px; border: 1px solid var(--cinnabar, #a8392b); border-radius: 2px; padding: 0 5px; line-height: 15px; background: rgba(168,57,43,.06); }
#panel .bg29 .bg29-desc { background: linear-gradient(90deg, rgba(233,223,198,.35), transparent); border-radius: 4px; padding: 0 2px; }
#panel .bg29 .ic-desc { font-size: 12.5px; color: var(--ink); }
#panel .bg29 .ic-acts { height: 44px; grid-template-rows: repeat(2, 20px); gap: 4px; }
#panel .bg29 .ic-acts button { height: 20px; border-color: rgba(107,90,66,.8); background: linear-gradient(#fdf9ec, #ece2c6); box-shadow: 0 1px 0 rgba(42,32,24,.25), inset 0 1px 0 #fff8; letter-spacing: 1px; }
#panel .bg29 .ic-acts button:active { transform: translateY(1px); box-shadow: none; }
#panel .bg29 .ic-acts button.pri { box-shadow: 0 1px 0 rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.18); }
#panel .bg29 .inv-empty { display: flex; }
#panel .bg29 .grid.inv.main, #panel .bg29 .grid.inv.hot { width: 380px !important; max-width: none !important; box-sizing: border-box; }

/* 物品标签（类别 · 数量 · 快捷栏 · 手上）不许被省略号吃掉：放不下就换行 */
html body #panel .bg29 .inv-card .ic-top .ic-tag, html body #panel .bg29 .ic-tag { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere; line-height: 1.3; }
