/**
 * 成员模块（登录 / 注册 / 找回密码）移动端适配
 * ------------------------------------------------------------
 * 适用范围：<=768px。所有规则均位于媒体查询内，桌面端零改动。
 *
 * 背景：member 页复用 default 模板的 DOM（.bm / .rfm / .lgfm / .nfl），
 * 但样式来自后台编译的 style_4_common.css，其中：
 *   - .rfm{width:760px}
 *   - .fwin .rfm,.nfl .f_c .rfm{width:500px}
 *   - .rfm .px{width:220px}
 *   - .lgfm{width:280px;float:left}
 *   - .bm_h{height:31px;white-space:nowrap;overflow:hidden}
 * 这些固定宽度在 390px 视口下会撑破容器；浮窗 #fwin_login 还会被 common.js
 * 写入内联 position:left/top/height，需在本文件中用 !important 覆盖。
 *
 * PWA：文件位于 template/ 前缀下，引入处用 filemtime 作为版本号破缓存。
 * 深色模式：颜色统一走 --dz-* / --gzuc-* 变量，不写死浅色值。
 */

@media (max-width: 768px) {

	/* 移动端侧栏是 translateX(100%) 放到屏幕外的，会撑大 documentElement.scrollWidth；
	 * 在根元素也裁掉横向溢出，避免出现“能横向拖动”的假象。仅小屏生效。 */
	html,
	body {
		max-width: 100% !important;
		overflow-x: hidden !important;
	}

	/* ============ 1. 固定页面：解除容器与表单固定宽度 ============ */
	#nv_member #wp,
	#nv_member #ct,
	#nv_member #ct.wp {
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		box-sizing: border-box;
	}

	#nv_member #ct .mn,
	#nv_member #ct .mn.mw {
		float: none !important;
		width: auto !important;
		max-width: 100% !important;
		overflow: visible;
	}

	#nv_member #ct .bm,
	#nv_member #ct .bm_c,
	#nv_member .nfl .f_c {
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		box-sizing: border-box;
	}

	#nv_member .nfl {
		min-height: 0 !important;
	}

	#nv_member .nfl .f_c {
		margin: 12px auto !important;
		padding: 16px !important;
	}

	/* 标题栏：原 31px + white-space:nowrap 会裁掉“立即注册/立即登录” */
	#nv_member #ct .bm_h {
		height: auto !important;
		min-height: 48px;
		line-height: 1.5 !important;
		white-space: normal !important;
		overflow: visible !important;
		padding: 12px 14px !important;
		box-sizing: border-box;
	}

	#nv_member #ct .bm_h h3,
	#nv_member #ct .bm_h .xs2 {
		display: block;
		margin: 0;
		line-height: 1.5;
	}

	#nv_member #ct .bm_h .y {
		float: none !important;
		display: block;
		margin: 6px 0 0;
		white-space: normal;
	}

	#nv_member #ct .bm_c {
		padding: 14px !important;
	}

	/* 登录页的 showPrompt 气泡绝对定位到帮助图标右侧，会撑出横向滚动；
	 * 移动端直接隐藏该辅助提示，不影响登录/找回表单本身。 */
	#nv_member [id^="custominfo_login_"] {
		display: none !important;
	}

	/* .rfm 在固定页是 760px，在浮窗/.nfl 内是 500px，统一改为自适应 */
	#nv_member #ct .rfm,
	#nv_member .nfl .f_c .rfm,
	#fwin_login .rfm {
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		margin: 0 0 12px !important;
		box-sizing: border-box;
	}

	#nv_member #ct .rfm table,
	#nv_member .nfl .f_c .rfm table,
	#fwin_login .rfm table,
	#nv_member #ct .rfm tbody,
	#nv_member .nfl .f_c .rfm tbody,
	#fwin_login .rfm tbody,
	#nv_member #ct .rfm tr,
	#nv_member .nfl .f_c .rfm tr,
	#fwin_login .rfm tr {
		display: block;
		width: 100% !important;
		max-width: 100%;
		box-sizing: border-box;
	}

	#nv_member #ct .rfm th,
	#nv_member .nfl .f_c .rfm th,
	#fwin_login .rfm th {
		float: none !important;
		display: block;
		width: auto !important;
		max-width: 100%;
		padding: 4px 0 2px !important;
		text-align: left !important;
		vertical-align: top;
		box-sizing: border-box;
	}

	#nv_member #ct .rfm td,
	#nv_member .nfl .f_c .rfm td,
	#fwin_login .rfm td {
		float: none !important;
		display: block;
		width: auto !important;
		max-width: 100%;
		padding: 2px 0 4px !important;
		text-align: left !important;
		vertical-align: top;
		box-sizing: border-box;
	}

	/* 表单行的第三列提示（注册页）改为换行显示，不再横向挤出屏幕 */
	#nv_member #ct .rfm td.tipcol,
	#fwin_login .rfm td.tipcol {
		display: block;
		width: auto !important;
		max-width: 100%;
		white-space: normal;
	}

	/* 原 .p_tip/.p_chk 固定 390px 且绝对定位，小屏会溢出 */
	#nv_member #ct .rfm .p_tip,
	#nv_member #ct .rfm .p_chk,
	#fwin_login .rfm .p_tip,
	#fwin_login .rfm .p_chk {
		position: static !important;
		width: auto !important;
		max-width: 100%;
		padding: 2px 0 0 !important;
		white-space: normal;
	}

	/* 登录方式下拉框模板里写了 inline float:left */
	#nv_member #ct .rfm .login_slct,
	#fwin_login .rfm .login_slct {
		float: none !important;
		display: block;
		width: 100%;
	}

	/* ============ 2. 输入框 / 下拉框 / 按钮：触摸友好 ============ */
	#nv_member #ct input.px,
	#nv_member #ct input.pt,
	#nv_member #ct select,
	#nv_member #ct textarea,
	#nv_member .nfl .f_c input.px,
	#nv_member .nfl .f_c select,
	#fwin_login input.px,
	#fwin_login select,
	#fwin_login textarea {
		width: 100% !important;
		max-width: 100% !important;
		height: 40px !important;
		min-height: 40px;
		line-height: 38px !important;
		padding: 0 10px !important;
		font-size: 16px !important; /* iOS 聚焦不自动放大 */
		box-sizing: border-box !important;
	}

	#nv_member #ct input.pc,
	#fwin_login input.pc {
		width: auto !important;
		height: auto !important;
		min-height: 0;
		line-height: normal !important;
	}

	#nv_member #ct button.pn,
	#nv_member #ct button.pnc,
	#nv_member .nfl .f_c button.pn,
	#fwin_login button.pn,
	#fwin_login button.pnc {
		min-width: 96px;
		min-height: 42px;
		margin-left: 0 !important;
		padding: 0 16px;
		font-size: 15px;
	}

	/* 验证码图片 / 问答刷新图标不撑破表单 */
	#nv_member #ct [id^="seccode_"] img,
	#nv_member #ct .seccodeimage,
	#fwin_login [id^="seccode_"] img,
	#fwin_login .seccodeimage {
		max-width: 100% !important;
		height: auto !important;
	}

	/* ============ 3. 找回密码固定页（.lgfm 原生 PC 两栏） ============ */
	#nv_member #ct .blr,
	#nv_member #ct .lgfm,
	#nv_member #ct .lgf {
		float: none !important;
		width: auto !important;
		max-width: 100% !important;
		min-width: 0 !important;
		box-sizing: border-box;
	}

	#nv_member #ct .lgfm {
		padding: 8px 0 16px !important;
		border-right: 0 !important;
	}

	#nv_member #ct .lgfm label,
	#nv_member #ct .lgfm p {
		display: block;
		clear: both;
		width: auto !important;
		max-width: 100%;
		line-height: 1.6;
	}

	#nv_member #ct .lgfm em,
	#nv_member #ct .fsb em {
		float: none !important;
		display: block;
		width: auto !important;
	}

	#nv_member #ct .lgfm .px {
		width: 100% !important;
		max-width: 100% !important;
	}

	#nv_member #ct .fsb {
		padding: 12px 0;
	}

	/* ============ 4. 浮窗 #fwin_login：覆盖 JS 内联定位与固定宽 ============ */
	#fwin_login.fwinmask {
		position: fixed !important;
		inset: 0 !important;
		left: 0 !important;
		right: 0 !important;
		top: 0 !important;
		bottom: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		height: 100% !important;
		max-height: none !important;
		margin: 0 !important;
		padding: 12px 12px calc(68px + env(safe-area-inset-bottom, 0px)) !important;
		overflow-x: hidden !important;
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch;
		box-sizing: border-box !important;
		background: rgba(0, 0, 0, .45);
		z-index: 1100 !important;
	}

	/* 反馈层必须浮在浮窗(1100)之上：#ntcwin 是 showError 的错误提示层、#fwin_dialog 是 showDialog 的等待/信息窗，
	 * 二者 z-index 由 JS 内联写入(≈501/401)，低于 #fwin_login 的 1100 时会被遮罩吞掉，造成"提交无反应"假象 */
	#ntcwin,
	#fwin_dialog {
		z-index: 1200 !important;
	}

	#fwin_login .fwin,
	#fwin_login .fwin tbody,
	#fwin_login .fwin tr {
		display: block;
		width: 100% !important;
		max-width: 100% !important;
		height: auto !important;
		max-height: none !important;
		margin: 0 auto;
		box-sizing: border-box;
	}

	/* 浮窗九宫格的左右/上下边框单元格在小屏隐藏，中间内容区铺满 */
	#fwin_login .fwin .t_l,
	#fwin_login .fwin .t_r,
	#fwin_login .fwin .m_l,
	#fwin_login .fwin .m_r,
	#fwin_login .fwin .b_l,
	#fwin_login .fwin .b_r,
	#fwin_login .fwin .t_c,
	#fwin_login .fwin .b_c {
		display: none !important;
	}

	#fwin_login .fwin .m_c {
		display: block;
		width: 100% !important;
		max-width: 100% !important;
		height: auto !important;
		max-height: none !important;
		padding: 0 !important;
		overflow: visible !important;
		box-sizing: border-box;
		border-radius: var(--dz-radius-m, 12px);
		background: var(--dz-bgf, #fff);
		box-shadow: var(--dz-shadow, 0 8px 24px rgba(0, 0, 0, .18));
	}

	#fwin_login .m_c .c {
		padding: 4px 14px 14px !important;
	}

	#fwin_login .m_c .o {
		padding: 10px 14px;
		height: auto;
	}

	/* 标题与关闭按钮：原 .flb 固定 20px 高，窄屏会重叠 */
	#fwin_login .flb {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 10px;
		height: auto !important;
		min-height: 48px;
		line-height: 1.5 !important;
		white-space: normal !important;
		overflow: visible !important;
		padding: 12px 14px !important;
		box-sizing: border-box;
		border-bottom: 1px solid var(--dz-borderb, #e5e5e5);
	}

	#fwin_login .flb em {
		float: none !important;
		min-width: 0;
		max-width: 100%;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	#fwin_login .flb span {
		flex: 0 0 auto;
	}

	#fwin_login .flbc {
		float: none !important;
		display: inline-block;
		min-width: 64px;
		min-height: 40px;
		line-height: 40px;
		padding: 0 12px;
		text-align: center;
	}
}
