/* V15.4.0 手机横屏专项布局：仅 body.phone-landscape 生效，平板/桌面不受影响 */
body.phone-landscape #player-panel{top:calc(var(--safe-top) + 5px);left:calc(var(--safe-left) + 7px);width:205px;padding:6px 8px;border-radius:9px}
body.phone-landscape #player-panel .player-name-line span:first-child{font-size:13px}body.phone-landscape #player-panel .hud-sub{font-size:7px;margin-top:1px}body.phone-landscape #player-panel .meter{height:3px;margin-top:2px}body.phone-landscape #player-panel .meter-labels{font-size:6px;margin-top:2px;gap:4px;flex-wrap:nowrap}body.phone-landscape #player-panel .hud-gender-switch button{height:17px;min-width:21px;padding:0 4px;font-size:7px}
body.phone-landscape #world-clock{top:calc(var(--safe-top) + 5px);padding:4px 7px;font-size:7px}
body.phone-landscape #coord-panel{top:calc(var(--safe-top) + 5px);right:calc(var(--safe-right) + 7px);min-width:150px;padding:6px 8px;border-radius:9px}body.phone-landscape #coord-panel .coord-row{gap:6px;font-size:7px}
body.phone-landscape #fullscreen-btn{top:calc(var(--safe-top) + 5px);right:calc(var(--safe-right) + 166px);width:28px;height:28px;font-size:14px}
body.phone-landscape #minimap-box{display:block!important;top:calc(var(--safe-top) + 39px);right:calc(var(--safe-right) + 7px);width:132px;height:88px;padding:4px;border-radius:9px}body.phone-landscape #minimap{width:122px;height:68px}body.phone-landscape .minimap-title{font-size:6px;padding-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.phone-landscape #game-settings-btn{top:calc(var(--safe-top) + 132px);right:calc(var(--safe-right) + 7px);height:27px;min-width:48px;padding:0 7px;font-size:8px}
body.phone-landscape #camera-mode-btn{right:calc(var(--safe-right) + 62px);bottom:calc(var(--safe-bottom) + 132px);transform:scale(.78);transform-origin:bottom right}
body.phone-landscape .camera-view-hint{display:none!important}
body.phone-landscape .utility-dock{top:calc(var(--safe-top) + 79px);left:calc(var(--safe-left) + 7px);gap:3px;padding:3px 4px;border-radius:9px;max-width:none}body.phone-landscape .utility-btn{width:31px;height:31px;padding:2px;border-radius:7px}body.phone-landscape .utility-rune{width:15px;height:15px;font-size:8px}body.phone-landscape .utility-btn b{font-size:5px}body.phone-landscape .utility-btn::after{display:none}
body.phone-landscape #joystick-zone{left:calc(var(--safe-left) + 18px);bottom:calc(var(--safe-bottom) + 10px);width:92px;height:92px}body.phone-landscape #joystick-zone .joystick-ring{inset:15px}body.phone-landscape #joystick-knob{width:39px;height:39px}
body.phone-landscape #action-cluster.combat-cluster{right:calc(var(--safe-right) + 7px);bottom:calc(var(--safe-bottom) + 7px);width:205px;height:118px;transform:none!important}
body.phone-landscape #action-cluster .action-btn.attack{right:0;bottom:0;width:64px;height:64px;font-size:13px}
body.phone-landscape #action-cluster .action-btn.run{right:70px;bottom:0;width:43px;height:43px;font-size:8px}
body.phone-landscape #action-cluster .action-btn.defend{right:118px;bottom:0;width:43px;height:43px;font-size:8px}
body.phone-landscape #action-cluster .action-btn.medium{right:69px;bottom:49px;width:45px;height:45px;font-size:8px}
body.phone-landscape #action-cluster .action-btn.cultivate{right:12px;bottom:70px;width:41px;height:41px;font-size:8px}
body.phone-landscape #skill-quick-dock{position:fixed!important;right:calc(var(--safe-right) + 120px);bottom:calc(var(--safe-bottom) + 55px);grid-template-columns:repeat(2,43px)!important;grid-auto-rows:43px!important;gap:5px!important;z-index:215!important}body.phone-landscape #skill-quick-dock .action-btn.skill{width:43px!important;height:43px!important;min-width:43px!important;font-size:9px!important}
body.phone-landscape .interaction-toggle-dock{right:calc(var(--safe-right) + 7px);bottom:calc(var(--safe-bottom) + 125px);display:flex;flex-direction:row;gap:4px}body.phone-landscape .auto-interact-toggle,body.phone-landscape .manual-touch-toggle{min-width:74px;height:21px;padding:0 6px;font-size:6px;gap:3px}body.phone-landscape .auto-interact-toggle b,body.phone-landscape .manual-touch-toggle b{font-size:7px}body.phone-landscape .auto-dot,body.phone-landscape .touch-dot{width:4px;height:4px}body.phone-landscape .interact-hint{display:none!important}
body.phone-landscape #cultivation-quick-dock{top:calc(var(--safe-top) + 166px);right:calc(var(--safe-right) + 7px);left:auto;zoom:.86}body.phone-landscape #cultivation-quick-dock.collapsed{zoom:.78}
body.phone-landscape #flight-height-controls{transform:scale(.76);transform-origin:right center}
body.phone-landscape .route-chip{bottom:calc(var(--safe-bottom) + 4px);max-width:38vw;padding:4px 7px;font-size:7px}
body.phone-landscape .side-panel{top:50%;right:calc(var(--safe-right) + 7px);width:min(420px,62vw);max-height:90dvh;padding:9px 10px}
body.phone-landscape .dialog-panel{width:min(520px,68vw);max-height:82dvh;padding:8px 10px}
body.phone-landscape .server-broadcast{max-width:40vw;top:36px;font-size:7px}
body.phone-landscape #layout-editor-bar{left:6px;right:6px;bottom:max(5px,var(--safe-bottom));transform:none;justify-content:center;gap:4px;padding:5px;flex-wrap:wrap}body.phone-landscape #layout-editor-bar span{width:100%;text-align:center;font-size:7px}body.phone-landscape #layout-editor-bar button{height:25px;padding:0 7px;font-size:8px}
body.phone-landscape.layout-editing [data-layout-widget="1"]{z-index:9300!important;outline-width:2px!important}body.phone-landscape.layout-editing [data-layout-widget="1"]::before{top:-11px;font-size:6px;padding:1px 3px}
body.phone-landscape #game-settings-panel .settings-card{width:94vw;max-height:92dvh;padding:8px 10px}body.phone-landscape #game-settings-panel .settings-head h3{font-size:14px}body.phone-landscape #game-settings-panel .settings-row{grid-template-columns:90px 1fr 48px;gap:6px;padding:5px 0}body.phone-landscape #game-settings-panel .settings-actions{gap:6px;margin-top:7px}body.phone-landscape #game-settings-panel .settings-actions button{min-height:30px;font-size:8px}
/* 自定义布局写入 inline left/top/zoom 后会覆盖以上默认位置，因此拖动和缩放可持久保存。 */

/* V15.4.1 手机实时展开地图 */
body.phone-landscape #world-map-panel .world-map-card{width:96vw;height:90dvh;max-width:none;padding:8px 9px}
body.phone-landscape #world-map-panel .world-map-canvas-wrap{min-height:0;flex:1}
body.phone-landscape #world-map-canvas{width:100%;height:100%;min-height:58dvh;image-rendering:auto}
body.phone-landscape #world-map-panel .world-atlas-wrap{display:none!important}
body.phone-landscape #world-map-title{font-size:14px}
body.phone-landscape #world-map-kicker,body.phone-landscape #world-map-status{font-size:7px}

/* V15.4.2 手机人物 / 地图关闭 / 自定义布局防误触 */

/* 展开地图的关闭键固定在屏幕右上，扩大实际触控区域。 */
body.phone-landscape #world-map-close{
  position:fixed!important;
  top:max(calc(var(--safe-top) + 7px),7px)!important;
  right:max(calc(var(--safe-right) + 7px),7px)!important;
  width:46px!important;height:46px!important;min-width:46px!important;
  border-radius:14px!important;
  z-index:10050!important;
  font-size:27px!important;line-height:42px!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  background:rgba(10,18,13,.94)!important;
  border:1px solid rgba(226,204,143,.56)!important;
  box-shadow:0 4px 18px rgba(0,0,0,.38)!important;
  touch-action:manipulation!important;
}
body.phone-landscape #world-map-panel:not(.hidden) #world-map-close{pointer-events:auto!important}

/* 地图卡片给关闭键留出空间，避免标题/状态压住关闭按钮。 */
body.phone-landscape #world-map-panel .world-map-head{padding-right:50px!important}
body.phone-landscape #world-map-panel{touch-action:manipulation}

/* 自定义布局时：控件仍然能被拖动，但浏览器不把拖动理解成“点按钮”。 */
body.layout-editing [data-layout-widget="1"]{
  touch-action:none!important;
  user-select:none!important;
  -webkit-user-select:none!important;
  -webkit-tap-highlight-color:transparent!important;
  cursor:move!important;
}
body.layout-editing [data-layout-widget="1"] button,
body.layout-editing button[data-layout-widget="1"]{
  pointer-events:auto!important;
}
body.layout-editing [data-layout-widget="1"]{
  box-shadow:0 0 0 2px rgba(236,202,102,.42),0 0 16px rgba(236,202,102,.14)!important;
}

/* V15.4.3 手机自定义布局大小滑杆 */
body.phone-landscape #layout-editor-bar .layout-size-control{width:min(58vw,300px);min-width:180px;justify-content:center}
body.phone-landscape #layout-size-range{width:min(40vw,210px);height:22px}
body.phone-landscape #layout-size-output{font-size:8px}
body.phone-landscape .utility-dock{max-width:calc(100vw - var(--safe-left) - var(--safe-right) - 16px)}

/* V15.4.4 手机头像与装配面板 */
body.phone-landscape #player-panel{width:232px!important;padding-left:50px!important}
body.phone-landscape #hud-avatar{left:7px;top:6px;width:36px;height:36px;border-radius:10px}
body.phone-landscape #hud-avatar span{font-size:16px;line-height:16px}
body.phone-landscape #hud-avatar small{font-size:6px}
body.phone-landscape #profile-panel{width:min(440px,76vw)!important}
body.phone-landscape .loadout-current-grid{grid-template-columns:1fr 1fr}
body.phone-landscape .loadout-choice-list,body.phone-landscape .loadout-artifact-list{grid-template-columns:1fr 1fr}
body.phone-landscape .loadout-choice,body.phone-landscape .loadout-artifact{padding:5px}
body.phone-landscape .profile-avatar-large{width:40px;height:40px}

/* V15.5.2 手机：法宝、飞剑、御剑独立显示 */
body.phone-landscape .artifact-ability-dock{
  grid-template-columns:18px 34px 34px 34px!important;
  grid-template-rows:34px!important;
}
body.phone-landscape .artifact-ability-dock #treasure-btn{grid-column:2!important;grid-row:1!important}
body.phone-landscape .artifact-ability-dock #flying-sword-btn{grid-column:3!important;grid-row:1!important}
body.phone-landscape .artifact-ability-dock #sword-flight-btn{grid-column:4!important;grid-row:1!important}
