/* 阿福杂货铺（L 号册页）——只有一个固定设计尺寸 760×366：任何屏幕上排版、字号、间距、格子大小都一模一样，
   屏幕放不下时整张册页等比缩小（缩放系数由 js 设置到 zoom），绝不改版式、不滚动、不截断。 */
#panel .pbox.k29box.gd29box { width: 760px !important; height: 366px !important; max-height: none !important; min-height: 0 !important; box-sizing: border-box;
  isolation: isolate; border: 0 !important; border-image: none !important; background: none !important; border-radius: 10px; padding: 0 !important; overflow: hidden; }
#panel .pbox.k29box.gd29box > .k29 { top: 24px; right: 28px; bottom: 26px; left: 28px; gap: 6px; }
#panel .pbox.k29box.gd29box .pclose { right: 8px; top: 8px; }

/* 宣纸册页：墨色细边 → 亮纸高光 → 宣纸纹理（paper.webp 叠 oldpaper.jpg，提亮一档）→ 边缘渐暗的晕染 */
.gd29box::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; border-radius: 10px; pointer-events: none;
  background-color: #eadcb6;
  background-image: url(../../assets/ui/ink/paper.webp), linear-gradient(rgba(248,241,221,.52), rgba(248,241,221,.52)), url(../../assets/ui/ink/oldpaper.jpg);
  background-size: 256px 256px, auto, cover; background-blend-mode: multiply, normal, normal; background-repeat: repeat, no-repeat, no-repeat; background-position: 0 0, 0 0, center;
  box-shadow: inset 0 0 0 2px #6b5a42, inset 0 0 0 4px rgba(251,246,230,.8), inset 0 0 0 5px rgba(140,116,66,.35), inset 0 0 34px 4px rgba(120,84,40,.38); }

/* 标题：居中；墨痕收底；铜钱是右侧一小块墨线框 */
.gd29box .k29-h { display: grid; grid-template-columns: 1fr auto auto 1fr; align-items: center; column-gap: 10px; height: 34px; padding-right: 30px; border-bottom: 0; position: relative; }
.gd29box .k29-h::after { content: ""; position: absolute; left: 0; right: 30px; bottom: -4px; height: 9px; background: url(../../assets/ui/ink/ink_stroke_1.webp) center / 100% 100% no-repeat; opacity: .75; pointer-events: none; }
.gd29box .k29-seal { grid-column: 2; }
.gd29box .k29-h h3 { grid-column: 3; font-size: 25px; letter-spacing: 9px; margin-right: -9px; }
.gd29box .k29-h > span { grid-column: 4; justify-self: end; display: inline-flex; align-items: baseline; gap: 5px; height: 22px; line-height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; color: var(--ink-3); background: var(--paper-hi); border: 1px solid var(--paper-edge); }
.gd29box .k29-h > span b { font-size: 13px; font-weight: 700; color: var(--ink); }
.gd29box .k29-tabs { margin-top: 0; }
.gd29box .k29-tab { height: 28px; padding: 0 0 5px; line-height: 20px; background: rgba(251,246,230,.5); border-color: rgba(140,116,66,.55); }
.gd29box .k29-tab.on { background: #fbf6e6; }
.gd29box .k29-bd { overflow: hidden; }

/* 大凹槽：框住 [左 4×2 格子 + 翻页 | 右 信息卡] */
.gd29 { --c: 84px; --bw: 6px; --nz: 15px; --pz: 14px; --ib: calc(var(--c) - 2 * var(--bw) - var(--nz) - var(--pz) - 5px);
  position: relative; height: 100%; display: flex; gap: 10px; min-height: 0; 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; }
.gd29 > * { position: relative; z-index: 1; image-rendering: auto; }
.gd29::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: .4; pointer-events: none; z-index: 0; }

/* 左：格子 */
.gd29-l { flex: none; display: flex; flex-direction: column; gap: 5px; }
.gd29-g { display: grid; grid-template-columns: repeat(4, var(--c)); grid-template-rows: repeat(2, var(--c)); gap: 6px; }
.gd29-g.none { display: flex; width: calc(var(--c) * 4 + 18px); height: calc(var(--c) * 2 + 6px); align-items: center; justify-content: center; border-radius: 12px; border: 2px dashed rgba(122,98,64,.35); box-sizing: border-box; }
.gd29-none { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink-3); }
.gd29-none img { width: 64px; height: auto; image-rendering: pixelated; }
.gd29-none b { font-size: 16px; color: var(--ink-2); font-family: "猫田楷", serif; font-weight: 400; letter-spacing: 3px; }
.gd29-none span { font-size: 12px; }
/* 一格 = 图标方框(固定边长) → 名牌(固定行高、同字号) → 价签(固定行高)，自上而下，互不重叠 */
.gd29-cell { position: relative; width: var(--c); height: var(--c); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px; padding: 1px 0 0; box-sizing: border-box;
  border: var(--bw) solid transparent; border-image: url(../../assets/v29/ui/ui_cell_idle.png) 12 fill stretch; image-rendering: pixelated; background: none; cursor: pointer; font: inherit; color: var(--ink); filter: drop-shadow(0 1px 0 rgba(42,32,24,.22)); }
.gd29-cell.on { border-image-source: url(../../assets/v29/ui/ui_cell_on.png); }
.gd29-cell.empty { border: 2px dashed rgba(122,98,64,.35); border-radius: 12px; cursor: default; filter: none; }
.gd29-cell.lack > .gd29-ic, .gd29-cell.lack > b, .gd29-cell.lack > em { filter: grayscale(1); opacity: .55; }
.gd29-ic { flex: none; display: flex; align-items: center; justify-content: center; }
.gd29-cell .gd29-ic { width: var(--ib); height: var(--ib); margin-top: 1px; }
.gd29-ic .ico { --s: 100%; width: 100%; height: 100%; }
.gd29-cv { width: 100%; height: 100%; display: block; image-rendering: auto; }
.gd29-cell b { flex: none; height: var(--nz); line-height: var(--nz); max-width: 100%; font-size: clamp(10px, calc((var(--c) - 2 * var(--bw) - 2px) / var(--n)), 12px); font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; }
.gd29-cell em { flex: none; width: calc(100% - 8px); height: var(--pz); line-height: var(--pz); border-top: 1px dashed rgba(107,90,66,.55); font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink-2); text-align: center; white-space: nowrap; }
.gd29-cell em small { font-size: 10px; font-weight: 400; margin-left: 1px; color: var(--ink-3); }
.gd29-cell.on em { color: var(--cinnabar); }
.gd29-cell u { position: absolute; right: -4px; top: -4px; text-decoration: none; font-size: 10px; line-height: 12px; padding: 0 3px; border: 1px solid var(--cinnabar); border-radius: 2px; background: var(--paper-hi); color: var(--cinnabar); letter-spacing: 1px; }
/* 翻页 */
.gd29-pg { flex: none; display: flex; align-items: center; justify-content: center; gap: 12px; height: 26px; margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.gd29-pg span { min-width: 54px; text-align: center; letter-spacing: 2px; background: var(--paper-hi); border: 1px solid var(--paper-edge); border-radius: 10px; padding: 0 10px; line-height: 20px; }
.gd29-pg span b { color: var(--ink); font-size: 15px; }
.gd29-arr { width: 60px; height: 26px; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 10px solid transparent; border-image: url(../../assets/v29/ui/ui_rb_sec.png) 14 fill stretch; image-rendering: pixelated; background: none; box-sizing: border-box; }
.gd29-arr:active { border-image-source: url(../../assets/v29/ui/ui_rb_sec_down.png); }
.gd29-arr i { width: 24px; height: 16px; background: url(../../assets/v29/ui/ui_op_arrow_l.png) center / contain no-repeat; image-rendering: pixelated; display: block; }
.gd29-arr.r i { background-image: url(../../assets/v29/ui/ui_op_arrow_r.png); }
.gd29-arr:disabled { border-image-source: url(../../assets/v29/ui/ui_rb_off.png); opacity: .6; cursor: default; }

/* 右：信息卡（自上而下固定五段：名称 / 三格读数 / 用途 / 数量 + 主按钮） */
.gd29-r { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; min-height: 0; box-sizing: border-box; padding: 0 2px; overflow: hidden;
  border: 10px 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)); }
.gd29-r::before { content: ""; position: absolute; right: 4px; bottom: 44px; width: 84px; height: 84px; background: url(../../assets/ui/ink/ink_basket.webp) center / contain no-repeat; opacity: .28; pointer-events: none; z-index: 0; }
.gd29-r > * { position: relative; z-index: 1; image-rendering: auto; }
.gd29-top { flex: none; display: flex; align-items: center; gap: 8px; height: 46px; }
.gd29-top::after { content: ""; flex: 1; align-self: stretch; background: url(../../assets/ui/ink/ink_bamboo.webp) right center / contain no-repeat; }
.gd29-big { flex: none; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border: 8px solid transparent; border-image: url(../../assets/v29/ui/ui_well.png) 12 fill stretch; image-rendering: pixelated; box-sizing: border-box; }
.gd29-big .gd29-ic { width: 30px; height: 30px; }
.gd29-nm { min-width: 0; display: flex; flex-direction: column; }
.gd29-nm b { font-size: 21px; font-family: "猫田楷", serif; font-weight: 400; letter-spacing: 3px; white-space: nowrap; overflow: hidden; line-height: 1.1; text-shadow: 0 1px 0 var(--paper-hi); }
.gd29-chips { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: 36px; border-top: 1px solid var(--paper-edge); border-bottom: 1px solid var(--paper-edge); }
.gd29-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; }
.gd29-chip + .gd29-chip { border-left: 1px solid var(--paper-edge); }
.gd29-chip small { font-size: 11px; color: var(--ink-3); letter-spacing: 2px; line-height: 13px; white-space: nowrap; }
.gd29-chip b { font-size: 15px; font-weight: 700; line-height: 18px; white-space: nowrap; }
.gd29-chip.hot b { font-size: 18px; }
.gd29-chip:nth-child(3) b { color: var(--cinnabar); font-family: "猫田楷", serif; font-weight: 400; font-size: 15px; letter-spacing: 2px; border: 1px solid var(--cinnabar); border-radius: 2px; padding: 0 5px; line-height: 16px; background: rgba(168,57,43,.06); }
.gd29-chip.off { opacity: .5; } .gd29-chip.off:nth-child(3) b { color: var(--ink-3); border-color: var(--ink-3); background: none; }
.gd29-desc { flex: 1 1 0; min-height: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.gd29-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); }
.gd29-desc p { margin: 0; font-size: 12.5px; line-height: 19px; max-height: 57px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gd29-act { flex: none; display: flex; align-items: center; gap: 8px; height: 38px; }
.gd29-qty { flex: none; display: flex; align-items: center; gap: 3px; }
.gd29-qty b { min-width: 26px; text-align: center; font-size: 17px; font-weight: 700; }
.gd29-qb { width: 26px; height: 28px; padding: 0; font: 15px/1 'Noto Sans SC', sans-serif; color: var(--ink); cursor: pointer; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-hi); }
.gd29-qb:active { background: var(--paper-lo); }
.gd29-qb.mx { width: auto; padding: 0 6px; font-size: 12px; }
.gd29-qb:disabled { opacity: .35; cursor: default; }
.gd29-go { flex: 1 1 auto; min-width: 0; width: auto; height: 38px; }

/* ===== 公共组件扩展：材料栏（制作卡）、格上锁、翻页行右侧小按钮 ===== */
.gd29-mats { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, 26px); gap: 3px; }
.gd29-mat { display: flex; align-items: center; gap: 4px; min-width: 0; padding: 0 4px; border: 1px solid var(--paper-edge); border-radius: 4px; background: rgba(251,246,230,.7); }
.gd29-mat.empty { border-style: dashed; background: none; }
.gd29-mat .gd29-ic { width: 20px; height: 20px; }
.gd29-mat > span { min-width: 0; display: flex; flex-direction: column; line-height: 12px; }
.gd29-mat > span small { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.gd29-mat > span b { font-size: 12px; font-weight: 700; white-space: nowrap; }
.gd29-mat > span b i { font-style: normal; font-weight: 400; color: var(--ink-3); font-size: 10.5px; }
.gd29-mat.no > span b { color: var(--cinnabar); }
.gd29-r.mk .gd29-desc p { -webkit-line-clamp: 2; max-height: 38px; }
.gd29-sub { font-size: 12px; color: var(--ink-3); line-height: 1.3; white-space: nowrap; }
.gd29-cell.lock { border-image-source: url(../../assets/v29/ui/ui_cell_lock.png); }
.gd29-cell.lock > .gd29-ic, .gd29-cell.lock > b { filter: grayscale(1); opacity: .55; }
.gd29-pg .gd29-ex { position: absolute; right: 0; top: 0; height: 26px; padding: 0 10px; font: 12px 'Noto Sans SC', sans-serif; color: var(--ink); cursor: pointer; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-hi); }
.gd29-pg { position: relative; }
.gd29-pg .gd29-ex:disabled { opacity: .35; cursor: default; }
/* 制作卡：名称一行 + 小字；材料 2×3；说明三行（行距 17） */
.gd29-r.mk .gd29-top { height: 42px; } .gd29-r.mk .gd29-big { width: 42px; height: 42px; border-width: 7px; } .gd29-r.mk .gd29-big .gd29-ic { width: 26px; height: 26px; }
.gd29-r.mk .gd29-mats { grid-template-rows: repeat(2, 23px); }
.gd29-r.mk .gd29-mat > span small { font-size: 10px; line-height: 10px; } .gd29-r.mk .gd29-mat > span b { font-size: 11.5px; line-height: 12px; }
.gd29-r.mk .gd29-mat .gd29-ic { width: 18px; height: 18px; }
.gd29-r.mk .gd29-desc p { font-size: 12px; line-height: 17px; -webkit-line-clamp: 3; max-height: 51px; }
.gd29-qty.off { opacity: .45; }

.gd29-pg .gd29-ex.l { left: 0; right: auto; }
/* 图鉴类「只看不买」详情：六格事实 + 长说明，不带数量/按钮 */
.gd29-facts { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 34px; border-top: 1px solid var(--paper-edge); border-bottom: 1px solid var(--paper-edge); }
.gd29-fact { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 0 3px; }
.gd29-fact:nth-child(n+4) { border-top: 1px solid var(--paper-edge); }
.gd29-fact:not(:nth-child(3n+1)) { border-left: 1px solid var(--paper-edge); }
.gd29-fact small { font-size: 10.5px; color: var(--ink-3); letter-spacing: 2px; line-height: 12px; white-space: nowrap; }
.gd29-fact b { font-size: 13px; font-weight: 700; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.gd29-r.cx .gd29-desc p { -webkit-line-clamp: 5; max-height: 95px; }
.gd29-cell.sil > .gd29-ic { filter: brightness(0); opacity: .22; }
.gd29-cell.sil > b { opacity: .5; }
.gd29-big.sil .gd29-ic { filter: brightness(0); opacity: .22; }
.gd29-flt { flex: none; display: flex; gap: 4px; height: 22px; }
.gd29-flt button { flex: 1; min-width: 0; padding: 0; font: 12px "Noto Sans SC", sans-serif; letter-spacing: 1px; color: var(--ink-2); background: transparent; border: 1px solid var(--paper-edge); border-radius: 11px; cursor: pointer; }
.gd29-flt button.on { color: #f6ecd4; background: var(--ink-1, #3a3226); border-color: var(--ink-1, #3a3226); font-weight: 700; }
