/**
 * 紧凑布局（html.layout-compact-ui）：约 87% 缩放 + rem 字号补偿。
 * 由 laptop-adaptive.js 按浏览器可视宽度自动启用。
 */

/* 历史版手动切换按钮（已废弃，防止旧缓存脚本仍插入 DOM） */
#sxh-layout-toggle,
.sxh-layout-toggle {
	display: none !important;
	visibility: hidden !important;
	pointer-events: none !important;
}
html.layout-compact-ui {
	--layout-compact-scale: 0.869;
	font-size: calc(16px / var(--layout-compact-scale));
	zoom: var(--layout-compact-scale);
	min-width: 0 !important;
}

html.layout-compact-ui .container {
	width: auto !important;
	max-width: 1200px;
	min-width: 0 !important;
}

html.layout-compact-ui,
html.layout-compact-ui body {
	height: calc(100vh / var(--layout-compact-scale, 0.869));
	height: calc(100dvh / var(--layout-compact-scale, 0.869));
	max-height: calc(100dvh / var(--layout-compact-scale, 0.869));
	min-height: 0;
	overflow: hidden;
	overscroll-behavior: none;
}

html.layout-compact-ui .app-shell {
	height: calc(100vh / var(--layout-compact-scale, 0.869));
	height: calc(100dvh / var(--layout-compact-scale, 0.869));
	max-height: calc(100dvh / var(--layout-compact-scale, 0.869));
	min-height: 0;
	overflow: hidden;
}

html.layout-compact-ui .img2-page-stage {
	flex: 1 1 auto;
	min-height: 0;
}

/* 生图/对话/视频：双栏高度交给 flex 链，避免 zoom 与 100dvh 硬算叠加出底部空白 */
html.layout-compact-ui .studio-columns {
	max-height: none;
	min-height: 0;
}

html.layout-compact-ui .img2-materials-rail {
	max-height: 100%;
}

html.layout-compact-ui .app-shell.is-gpt55-page {
	height: calc(100vh / var(--layout-compact-scale, 0.869));
	height: calc(100dvh / var(--layout-compact-scale, 0.869));
	max-height: calc(100dvh / var(--layout-compact-scale, 0.869));
}

html.layout-compact-ui .inspire-result-inner .preview .result-thumb-wrap > img,
html.layout-compact-ui .inspire-result-inner .preview.preview--count-many .result-thumb-wrap > img {
	max-height: calc((100vh - 260px) / var(--layout-compact-scale, 0.869));
	max-height: min(100%, calc((100dvh - 260px) / var(--layout-compact-scale, 0.869)));
}

/* ═══ 款视界 Ecom 工作台（studio / 首页 / 历史 / 模特·姿势广场等） ═══ */
html.layout-compact-ui .studio-app {
	min-height: calc(100dvh / var(--layout-compact-scale, 0.869));
}

html.layout-compact-ui body.page-studio .studio-app,
html.layout-compact-ui .studio-app.page-home,
html.layout-compact-ui .studio-app.page-history,
html.layout-compact-ui .studio-app.page-canvas,
html.layout-compact-ui body.page-studio.studio-home-active .studio-app.page-studio,
html.layout-compact-ui body.page-studio.studio-home-active .studio-app.page-home {
	height: calc(100dvh / var(--layout-compact-scale, 0.869));
	max-height: calc(100dvh / var(--layout-compact-scale, 0.869));
	min-height: 0;
	overflow: hidden;
}

html.layout-compact-ui body.ecom-promo-visible .studio-app.page-home,
html.layout-compact-ui body.ecom-promo-visible .studio-app.page-history,
html.layout-compact-ui body.ecom-promo-visible .studio-app.page-cases,
html.layout-compact-ui body.page-studio.ecom-promo-visible .studio-app {
	height: calc((100dvh - var(--ecom-promo-h, 0px)) / var(--layout-compact-scale, 0.869));
	max-height: calc((100dvh - var(--ecom-promo-h, 0px)) / var(--layout-compact-scale, 0.869));
	min-height: calc((100dvh - var(--ecom-promo-h, 0px)) / var(--layout-compact-scale, 0.869));
}

html.layout-compact-ui body.page-model-plaza .studio-app,
html.layout-compact-ui body.page-pose-plaza .studio-app {
	min-height: calc(100dvh / var(--layout-compact-scale, 0.869));
	height: calc(100dvh / var(--layout-compact-scale, 0.869));
	max-height: calc(100dvh / var(--layout-compact-scale, 0.869));
	overflow: hidden;
}

html.layout-compact-ui body.page-model-plaza .mp-main,
html.layout-compact-ui body.page-pose-plaza .pp-main {
	min-height: 0;
}

html.layout-compact-ui body.page-history {
	height: calc(100dvh / var(--layout-compact-scale, 0.869));
	max-height: calc(100dvh / var(--layout-compact-scale, 0.869));
}

html.layout-compact-ui .studio-canvas,
html.layout-compact-ui .studio-canvas .icon-rail {
	height: calc(100dvh / var(--layout-compact-scale, 0.869));
}

html.layout-compact-ui body.page-studio .studio-body,
html.layout-compact-ui body.page-studio .studio-stage {
	min-height: 0;
}

/* 笔记本紧凑布局：筛选条允许换行，避免标签与指示器挤压 */
html.layout-compact-ui .home-showcase-toolbar.home-broker-filters-bar,
html.layout-compact-ui .home-case-filters-bar {
	row-gap: 10px;
}
html.layout-compact-ui .home-broker-filters-bar .home-broker-sort-tags,
html.layout-compact-ui .home-broker-filters-bar .home-broker-time-tags {
	flex-wrap: wrap;
}
html.layout-compact-ui .wb-topbar {
	min-height: var(--studio-row-h, 52px);
}