/* v2.7 小空间进度条：紧贴屏幕上沿，一条细横幅，不挡画面 */
body.solo26 #jw-hud { top: env(safe-area-inset-top, 0px) !important; border-top: 0; border-radius: 0 0 6px 6px; padding: 2px 12px 3px; font-size: 12px; line-height: 1.4;
  max-width: calc(100vw - 360px); white-space: normal; text-align: center; }

/* v2.7 营造册：整本固定大小；左边一类建筑一次摆全（最多 3×2），卡片随格子撑满；右栏固定宽、内容一屏看全，按钮贴底 */
.pbox.bk263 { width: min(900px, 97vw) !important; height: min(440px, calc(100vh - 12px)) !important; height: min(440px, calc(100dvh - 12px)) !important; display: flex !important; flex-direction: column; }
.pbox.bk263 > .pbody { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden !important; max-height: none !important; }
.pbox.bk263 .bk-tabs { flex: none; }
.pbox.bk263 .bk-main { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 272px !important; grid-template-rows: minmax(0, 1fr); gap: 10px; align-items: stretch !important; }
.pbox.bk263 .bk-left { min-height: 0; height: 100%; display: flex; flex-direction: column; }
.pbox.bk263 .bk-grid2 { flex: 1 1 auto; min-height: 0; display: grid; gap: 8px; }
.pbox.bk263 .bk-grid2.g1x1 { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.pbox.bk263 .bk-grid2.g2x1 { grid-template: minmax(0, 1fr) / repeat(2, minmax(0, 1fr)); }
.pbox.bk263 .bk-grid2.g3x1 { grid-template: minmax(0, 1fr) / repeat(3, minmax(0, 1fr)); }
.pbox.bk263 .bk-grid2.g3x2 { grid-template: repeat(2, minmax(0, 1fr)) / repeat(3, minmax(0, 1fr)); }
.pbox.bk263 .bk-card2 { height: 100% !important; min-height: 0 !important; justify-content: flex-end; }
.pbox.bk263 .bk-card2 canvas { flex: 1 1 auto; min-height: 0; height: auto !important; width: 100%; margin: 0 !important; }
.pbox.bk263 .bk-card2 b, .pbox.bk263 .bk-card2 small { flex: none; }
.pbox.bk263 .bk-pager { display: none !important; }
.pbox.bk263 .bk-right { height: 100%; min-height: 0; max-height: none !important; overflow: hidden !important; display: flex; flex-direction: column; box-sizing: border-box; }
.pbox.bk263 .bk-one { margin: 0 0 4px; font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; max-height: 2.9em; -webkit-box-orient: vertical; overflow: hidden; }
.pbox.bk263 .bk-info { display: flex; gap: 4px; margin: 0 0 4px; }
.pbox.bk263 .bk-info span { flex: 1; text-align: center; font-size: 11px; line-height: 18px; color: #5a5048; background: rgba(58,52,54,.07); border: 1px solid rgba(58,52,54,.16); border-radius: 3px; white-space: nowrap; }
.pbox.bk263 .bk-info span:empty { display: none; }
.pbox.bk263 .bk-need { margin: 0 0 3px; }
.pbox.bk263 .bn-mats { display: grid !important; grid-template-columns: 1fr 1fr; gap: 3px; margin: 0 0 4px; }
.pbox.bk263 .bn-mat { grid-template-columns: 18px 1fr auto; gap: 3px; height: 26px; padding: 0 1px; border-left-width: 5px; border-right-width: 5px; font-size: 11.5px; }
.pbox.bk263 .bn-mat .ico { --s: 18px; }
.pbox.bk263 .bn-mat span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pbox.bk263 .bk-hint { margin: 0 0 4px !important; }
.pbox.bk263 .actions226 { margin-top: auto !important; }
.pbox.bk263 .actions226 button { height: 34px; flex: none; }
@media (max-height: 430px) {
  .pbox.bk263 .bk-card2 b { font-size: 13px; letter-spacing: 1px; }
  .pbox.bk263 .bk-card2 small { font-size: 10.5px; }
  .pbox.bk263 .bk-grid2 { gap: 6px; }
  .pbox.bk263 .bk-main { grid-template-columns: minmax(0, 1fr) 256px !important; }
  .pbox.bk263 .bk-need, .pbox.bk263 .bk-hint { display: none !important; }
  .pbox.bk263 .bk-dh { margin: -8px 0 2px; }
  .pbox.bk263 .bk-dh h4 { font-size: 16px; }
  .pbox.bk263 .bn-mat { height: 24px; border-top-width: 3px; border-bottom-width: 3px; }
  .pbox.bk263 .actions226 button { height: 32px; }
}

/* 耕牛：心情小脸 */
.ox27-face { display: inline-block; width: 24px; height: 24px; vertical-align: -7px; margin-right: 2px; background: url(../assets/v27/ox/ui_ox_icons.png) 0 0 / 288px 24px no-repeat; image-rendering: pixelated; }
.ox27-mood b { color: #a8392b; }
/* 陪它晒太阳：界面淡出，画面推近，一层暖光 */
body.sun27 #hud, body.sun27 #hud-tl, body.sun27 #hud-tr, body.sun27 #hotbar-wrap, body.sun27 #joy, body.sun27 #btn-act, body.sun27 #btn-pounce, body.sun27 .hs-console, body.sun27 #dx-console, body.sun27 #minimap-wrap, body.sun27 #toast { opacity: 0 !important; pointer-events: none !important; transition: opacity 1.4s ease; }
#game { transition: transform 2.6s ease-in-out; }
#sun27 { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 40; pointer-events: none; opacity: 0; transition: opacity 1.6s ease; }
#sun27.on { opacity: 1; }
#sun27 .s27-glow { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: radial-gradient(ellipse at 50% 55%, rgba(255,236,190,0) 30%, rgba(255,214,150,.18) 62%, rgba(70,46,24,.42) 100%); }
#sun27.k-rain .s27-glow { background: radial-gradient(ellipse at 50% 55%, rgba(200,214,226,0) 30%, rgba(120,140,160,.2) 62%, rgba(30,38,48,.5) 100%); }
#sun27.k-dusk .s27-glow { background: radial-gradient(ellipse at 50% 55%, rgba(255,190,140,0) 25%, rgba(240,140,90,.22) 60%, rgba(70,30,30,.5) 100%); }
#sun27 .s27-t { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 18px); transform: translateX(-50%); text-align: center; color: #f6ecd6; text-shadow: 0 1px 3px rgba(40,26,16,.8); letter-spacing: 4px; }
#sun27 .s27-t b { display: block; font-size: 20px; font-weight: 700; }
#sun27 .s27-t span { display: block; margin-top: 4px; font-size: 13px; letter-spacing: 2px; opacity: .9; }
#sun27 #s27-up { pointer-events: auto; position: absolute; right: calc(env(safe-area-inset-right, 0px) + 18px); bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); padding: 6px 18px; font-size: 15px; letter-spacing: 4px;
  color: #3a2e22; background: rgba(246,236,214,.92); border: 2px solid #8a6a4a; border-radius: 4px; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.dx-box .dx-left .dx-pic { height: 84px !important; min-height: 0 !important; }
.dx-box .dx-left .dx-pic i { transform: translateY(2px) scale(1.05) !important; }
.dx-box .dx-left .dx-stat span { font-size: 12px; line-height: 1.4; }

/* v2.7 测试台：只留一个入口 */
#hs-console, #dx-console { display: none !important; }
#t27-btn { display: block; }
body.sun27 #t27-btn { opacity: 0 !important; pointer-events: none !important; }
.pbox.t27-box { width: min(900px, 97vw) !important; height: min(460px, calc(100vh - 12px)) !important; height: min(460px, calc(100dvh - 12px)) !important; display: flex !important; flex-direction: column; }
.pbox.t27-box > .pbody { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden !important; max-height: none !important; }
.t27-tabs { flex: none; display: flex; gap: 4px; margin: 0 0 6px; border-bottom: 1px solid rgba(58,52,54,.25); }
.t27-tabs button { flex: 1; height: 32px; padding: 0 !important; border: 1px solid rgba(58,52,54,.3) !important; border-bottom: 0 !important; border-radius: 3px 3px 0 0 !important; background: rgba(58,52,54,.06) !important; color: #5a5048 !important; box-shadow: none !important; font-size: 14px; letter-spacing: 2px; }
.t27-tabs button.on { background: #efe7d4 !important; color: #2a2018 !important; font-weight: 700; box-shadow: inset 0 -3px 0 #3a3436 !important; }
.t27-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.t27-body h5 { margin: 6px 0 4px; font-size: 12px; letter-spacing: 3px; color: #7a6c58; border-top: 1px dashed rgba(58,52,54,.25); padding-top: 5px; }
.t27-body h5:first-child { border-top: 0; padding-top: 0; }
.t27-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 5px; }
.t27-grid button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 34px; padding: 5px 8px !important; text-align: left; background: #3f5248 !important; color: #f2ead8 !important; border: 0 !important; border-radius: 3px !important; box-shadow: 0 2px 0 rgba(0,0,0,.2) !important; }
.t27-grid button.on { background: #a8584c !important; }
.t27-grid button b { font-size: 13.5px; letter-spacing: 1px; font-weight: 700; }
.t27-grid button small { font-size: 11px; line-height: 1.3; opacity: .82; }

/* 晒太阳：点哪里都能起身 */
#sun27.tap { pointer-events: auto; }
#sun27 .s27-hint { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); transform: translateX(-50%); color: #f6ecd6; font-size: 13px; letter-spacing: 3px; opacity: .75; text-shadow: 0 1px 3px rgba(40,26,16,.8); pointer-events: none; }
