/**
 * 移动端 APP 化体验（方案 B · wind 响应式深化 + C 式局部增强）
 * ------------------------------------------------------------
 * 只作用于 <=768px 的移动端；桌面端（>768px）零改动。
 * 依赖 gzuc_dark.css 暴露的 --gzuc-* 变量，深浅色自动跟随 html.dark。
 * PWA 兼容：本文件位于 template/ 前缀下，会被官方 SW 以 cache-first 缓存，
 *           引入处用 filemtime 作为版本号破缓存（见 header_common.php）。
 *
 * v2（2026-11-20）排版优化：
 *  1. Hero 侧栏快捷入口 / 热点速报各占一行
 *  2. 好站导航 / UC工具箱 整段移动端隐藏
 *  3. 精选 / 惠选 / 旗下产品 统一"一屏一主题"横滑
 *  4. 页脚 APP 化精简，仅保留一行版权
 */

/* 桌面端默认：移动端专用元素隐藏
 * 这些元素由 footer.php / JS 注入到所有页面，必须在此给出媒体查询外的默认隐藏规则，
 * 否则 >768px 时媒体查询不生效，元素回落到浏览器默认 display，造成 PC 端露出移动端 UI。
 * 媒体查询内的同权重规则（后于本块）及 body:not(...) 更高权重规则负责在移动端重新开启。
 */
.gzuc-app-tabbar,
.gzuc_featured-dots,
.gzuc_tool-mobile-entry {
	display: none;
}

@media (max-width: 768px) {

	/* ============ 1. 底部导航栏（APP tabbar） ============ */
	.gzuc-app-tabbar {
		display: none;
	}

	body:not(.gzuc-diy-edit) .gzuc-app-tabbar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		display: flex;
		align-items: stretch;
		height: calc(56px + env(safe-area-inset-bottom, 0px));
		padding-bottom: env(safe-area-inset-bottom, 0px);
		box-sizing: border-box;
		background: var(--gzuc-bg-card, #fff);
		border-top: 1px solid var(--gzuc-border-light, #e8e8ed);
		box-shadow: 0 -2px 12px rgba(0, 0, 0, .06);
		z-index: 998;
	}

	body:not(.gzuc-diy-edit) {
		padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
	}

	.gzuc-tab {
		flex: 1 1 0;
		min-width: 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		min-height: 44px;
		color: var(--gzuc-text-3, #86868b);
		text-decoration: none;
		font-size: 11px;
		line-height: 1.2;
		-webkit-tap-highlight-color: transparent;
	}

	.gzuc-tab svg {
		width: 22px;
		height: 22px;
		fill: none;
		stroke: currentColor;
		stroke-width: 1.8;
		stroke-linecap: round;
		stroke-linejoin: round;
	}

	.gzuc-tab.is-active {
		color: var(--gzuc-primary, #FF6600);
	}

	.gzuc-tab:active {
		opacity: .7;
	}

	/* ============ 2. 隐藏模块：好站导航 / UC工具箱 ============ */
	.gzuc_hide_mobile {
		display: none !important;
	}

	/* ============ 3. Hero 侧栏：快捷入口 / 热点速报 各占一行 ============ */
	.gzuc_hero-sidebar {
		flex-direction: column !important;
	}

	.gzuc_hero-card {
		flex: none !important;
		width: 100% !important;
		min-width: 0;
	}

	/* ============ 4. 一屏一主题横滑（精选 / 惠选 / 旗下产品） ============ */
	.gzuc_section_featured .gzuc_cards-row {
		display: flex;
		gap: 12px;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		scroll-padding-left: 16px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding: 0 16px 6px;
		margin: 0 -16px;
	}

	.gzuc_section_featured .gzuc_cards-row::-webkit-scrollbar {
		display: none;
	}

	.gzuc_section_featured .gzuc_card {
		flex: 0 0 86%;
		scroll-snap-align: center;
		scroll-snap-stop: always;
	}

	.gzuc_section_featured .gzuc_card-img {
		height: 190px;
	}

	.gzuc_section_featured .gzuc_card-body {
		padding: 16px;
	}

	.gzuc_section_featured .gzuc_card-title {
		font-size: 16px;
		min-height: 0;
	}

	/* 旗下产品：把 5 列 grid 改为横向 snap 列表，一项一屏 */
	.gzuc_section_brand .gzuc_brand-grid {
		display: flex !important;
		gap: 12px;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		scroll-padding-left: 16px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		margin: 16px -16px 0;
		padding: 0 16px 6px;
	}

	.gzuc_section_brand .gzuc_brand-grid::-webkit-scrollbar {
		display: none;
	}

	.gzuc_section_brand .gzuc_brand-item {
		flex: 0 0 86%;
		scroll-snap-align: center;
		scroll-snap-stop: always;
		padding: 28px 16px;
	}

	.gzuc_section_brand .gzuc_brand-logo {
		width: 64px;
		height: 64px;
		font-size: 22px;
	}

	/* 横滑圆点指示器（精选 / 惠选 / 品牌共用） */
	.gzuc_featured-dots {
		display: flex;
		justify-content: center;
		align-items: center;
		gap: 6px;
		margin-top: 10px;
	}

	.gzuc_featured-dots i {
		width: 6px;
		height: 6px;
		border-radius: 3px;
		background: var(--gzuc-border-dark, #c7c7cc);
		transition: width .2s ease, background .2s ease;
	}

	.gzuc_featured-dots i.is-active {
		width: 16px;
		background: var(--gzuc-primary, #FF6600);
	}

	/* ============ 5. 页脚 APP 化精简 ============ */
	.gzuc_footer {
		padding: 16px 0 12px !important;
		margin-top: 8px !important;
	}

	.gzuc_footer .gzuc_footer-grid,
	.gzuc_footer .gzuc_footer-brand p,
	.gzuc_footer .gzuc_footer-links,
	.gzuc_footer .gzuc_footer-col {
		display: none !important;
	}

	.gzuc_footer .gzuc_footer-brand h3 {
		font-size: 14px !important;
		margin: 0 0 8px !important;
	}

	.gzuc_footer .gzuc_footer-bottom {
		border-top: none !important;
		padding: 0 !important;
		margin: 0 !important;
		font-size: 11px !important;
		color: var(--gzuc-text-3, #86868b);
		text-align: center;
		line-height: 1.6;
	}

	.gzuc_footer .gzuc_footer-bottom > div:first-child {
		margin: 0 !important;
	}

	.gzuc_footer .gzuc_footer-bottom-links {
		justify-content: center;
		margin-top: 2px !important;
	}

	/* Discuz 原生页脚版权条也压缩 */
	#fd_page_bottom,
	.dz_footc {
		font-size: 11px !important;
	}

	/* ============ 6. 通用排版 APP 化 ============ */
	.gzuc_section {
		margin-bottom: 24px;
	}

	.gzuc_section-title {
		font-size: 17px;
	}

	.gzuc_section-sub a,
	.gzuc_section-more,
	.gzuc_more {
		min-height: 44px;
		display: inline-flex;
		align-items: center;
		padding-left: 6px;
	}

	.gzuc_news-three {
		grid-template-columns: 1fr;
	}

	.gzuc_vision-grid {
		grid-template-columns: 1fr 1fr;
	}
}
