/* ============================================
   Watch-Binding H5 — ICCID Entry Page
   Design: Editorial Warm · Premium · Clean
   Compatible: iOS 10+ / Android 5+ / All WebView / Desktop
   ============================================ */

/* ---- Reset & Base ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
	height: auto;
	-webkit-text-size-adjust: 100%;
	-ms-text-size-adjust: 100%;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft Yahei", "Helvetica Neue", sans-serif;
	color: #1a1a24;
	font-size: 15px !important;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	-webkit-tap-highlight-color: transparent;
	-webkit-touch-callout: none;
	-webkit-text-size-adjust: 100% !important;
	touch-action: manipulation;
	background: #F7F5F0;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	min-height: var(--vh, 100vh);
}

/* Subtle grain texture overlay */
body::before {
	content: '';
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 0;
	pointer-events: none;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
	background-repeat: repeat;
	background-size: 180px 180px;
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
.main {
	flex: 1 0 auto;
	position: relative;
	z-index: 1;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-y: contain;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: flex-start;
	padding-top: 56px;
	padding-top: calc(56px + env(safe-area-inset-top, 0px));
	padding-bottom: 48px;
	padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
	padding-left: env(safe-area-inset-left, 0px);
	padding-right: env(safe-area-inset-right, 0px);
}

.main .content {
	width: 100%;
	max-width: 400px;
	padding-left: 16px;
	padding-right: 16px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

/* ============================================
   1. CARD IMAGE — Hero visual block
   ============================================ */
.main .imgBox {
	width: 160px;
	height: 160px;
	margin-bottom: 24px;
	position: relative;
}

.main .imgBox::after {
	content: '';
	position: absolute;
	bottom: -8px;
	left: 50%;
	transform: translateX(-50%);
	width: 140px;
	height: 12px;
	background: radial-gradient(ellipse, rgba(0,0,0,0.08) 0%, transparent 70%);
	border-radius: 50%;
}

.main .imgBox img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	filter: drop-shadow(0 8px 24px rgba(0,0,0,0.08));
}

/* ============================================
   2. LOGIN FORM
   ============================================ */
.login-content {
	width: 100%;
}

/* "扫一扫更便捷" hint label */
.login-content .scanIcon {
	width: 100%;
	display: flex;
	justify-content: flex-end;
	align-items: center;
	margin-bottom: 8px;
}

.login-content .scanIcon .scanIconText {
	font-size: 12px;
	font-weight: 500;
	color: #B84040;
	letter-spacing: 0.3px;
	padding: 4px 10px;
	background: rgba(184, 64, 64, 0.06);
	border-radius: 4px;
}

/* Input + Scan Row — soft white card */
.login-content .loging {
	width: 100%;
	height: 52px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #FFFFFF;
	border-radius: 12px;
	padding-left: 16px;
	padding-right: 6px;
	box-shadow:
		0 1px 2px rgba(0,0,0,0.03),
		0 4px 16px rgba(0,0,0,0.04);
	transition: box-shadow 0.2s;
}

.login-content .loging:focus-within {
	box-shadow:
		0 1px 2px rgba(0,0,0,0.04),
		0 4px 20px rgba(0,0,0,0.07),
		0 0 0 2px rgba(210, 70, 70, 0.12);
}

.login-content .loging #iccid {
	flex: 1;
	min-width: 0;
	height: 100%;
	border: none;
	background: transparent;
	font-size: 16px;
	color: #1a1a24;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	border-radius: 0;
}

.login-content .loging #iccid::placeholder {
	color: #B0B0B8;
	font-weight: 400;
}

.login-content .loging #scanqrcode {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: #F5F3EF;
	border: none;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.15s;
	-webkit-tap-highlight-color: transparent;
	-webkit-appearance: none;
	appearance: none;
}

.login-content .loging #scanqrcode img {
	display: block;
	width: 20px;
	height: 20px;
	opacity: 0.65;
	pointer-events: none;
}

.login-content .loging #scanqrcode:active {
	background: #EBE8E3;
}

/* Suggestions Dropdown */
#suggestions {
	width: 100%;
	max-height: 160px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: #fff;
	border-radius: 0 0 12px 12px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.06);
	margin-top: -4px;
}

/* Submit Button */
.login-content #submitBtn {
	width: 100%;
	height: 52px;
	background: #D24646;
	border-radius: 14px;
	border: none;
	margin-top: 20px;
	font-size: 16px;
	font-weight: 600;
	color: #FFFFFF;
	letter-spacing: 1px;
	cursor: pointer;
	transition: background 0.15s, transform 0.1s;
	box-shadow: 0 4px 16px rgba(210, 70, 70, 0.25);
	-webkit-tap-highlight-color: transparent;
	-webkit-appearance: none;
	appearance: none;
	-webkit-user-select: none;
	user-select: none;
}

.login-content #submitBtn:active {
	background: #BA3A3A;
	transform: scale(0.98);
}

/* ============================================
   3. TIPS SECTION
   ============================================ */
.main .massage {
	width: 100%;
	background: #FFFFFF;
	border-radius: 14px;
	padding: 20px 18px;
	margin-top: 36px;
	margin-bottom: 24px;
	margin-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
	box-shadow:
		0 1px 2px rgba(0,0,0,0.03),
		0 4px 20px rgba(0,0,0,0.05);
}

.main .massage h4 {
	font-size: 14px;
	font-weight: 600;
	color: #1a1a24;
	line-height: 1.3;
	margin-bottom: 12px;
}

.main .massage p {
	font-size: 12px;
	font-weight: 400;
	color: #8E8E98;
	line-height: 1.8;
	margin: 0;
	padding-left: 4px;
	word-break: break-all;
}

/* ============================================
   4. SMALL SCREEN (≤ 360px)
   ============================================ */
@media screen and (max-width: 360px) {
	.main .imgBox {
		width: 140px;
		height: 140px;
	}

	.main .content {
		padding-left: 12px;
		padding-right: 12px;
	}

	.login-content .loging #iccid {
		font-size: 15px;
	}

	.login-content .loging #iccid::placeholder {
		font-size: 13px;
	}
}

/* ============================================
   5. TABLET (≥ 600px)
   ============================================ */
@media screen and (min-width: 600px) {
	.main .content {
		max-width: 440px;
	}

	.main .imgBox {
		width: 190px;
		height: 190px;
		margin-bottom: 32px;
	}

	.main .imgBox::after {
		width: 160px;
		height: 14px;
	}

	body {
		font-size: 16px !important;
	}
}

/* ============================================
   6. DESKTOP (≥ 900px) — comfortable layout
   ============================================ */
@media screen and (min-width: 900px) {
	/* ★ 关键：重置 public.css 的 html font-size，避免 rem 单位在桌面端异常缩放 */
	html {
		font-size: 16px !important;
	}

	.main {
		align-items: center;
		padding-top: 40px;
		padding-bottom: 40px;
	}

	.main .content {
		max-width: 520px;
	}

	.main .imgBox {
		width: 220px;
		height: 220px;
		margin-bottom: 36px;
	}

	.main .imgBox::after {
		width: 180px;
		height: 14px;
		bottom: -10px;
	}

	.login-content .scanIcon {
		margin-bottom: 10px;
	}

	.login-content .scanIcon .scanIconText {
		font-size: 13px;
		padding: 5px 12px;
	}

	.login-content .loging {
		height: 56px;
		border-radius: 14px;
		padding-left: 20px;
		padding-right: 8px;
	}

	.login-content .loging #iccid {
		font-size: 17px;
	}

	.login-content .loging #scanqrcode {
		width: 44px;
		height: 44px;
		border-radius: 12px;
	}

	.login-content .loging #scanqrcode img {
		width: 22px;
		height: 22px;
	}

	.login-content #submitBtn {
		height: 56px;
		border-radius: 16px;
		margin-top: 24px;
		font-size: 18px;
		letter-spacing: 2px;
	}

	.main .massage {
		border-radius: 16px;
		padding: 24px 22px;
		margin-top: 44px;
	}

	.main .massage h4 {
		font-size: 15px;
	}

	.main .massage p {
		font-size: 13px;
	}

	/* layer 弹窗 — 覆盖 layer.css 的 rem 单位 */
	.layui-m-layerchild {
		font-size: 16px !important;
	}

	.layui-m-layer2 .layui-m-layerchild {
		max-width: 320px !important;
		font-size: 16px !important;
	}
}

/* ============================================
   7. LARGE DESKTOP (≥ 1200px) — extra polish
   ============================================ */
@media screen and (min-width: 1200px) {
	.main .content {
		max-width: 560px;
	}

	.main .imgBox {
		width: 240px;
		height: 240px;
		margin-bottom: 40px;
	}

	.login-content .loging {
		height: 60px;
	}

	.login-content .loging #iccid {
		font-size: 18px;
	}

	.login-content .loging #scanqrcode {
		width: 48px;
		height: 48px;
	}

	.login-content .loging #scanqrcode img {
		width: 24px;
		height: 24px;
	}

	.login-content #submitBtn {
		height: 60px;
		margin-top: 28px;
		font-size: 19px;
	}

	/* layer 弹窗 — 桌面端适配 */
	.layui-m-layerchild {
		font-size: 18px !important;
	}

	.layui-m-layer2 .layui-m-layerchild {
		max-width: 360px !important;
		font-size: 18px !important;
	}
}

#YSF-BTN-HOLDER {
	display: none !important;
}

/* ============================================
   8. SITE FOOTER — 备案号
   ============================================ */
.site-footer {
	position: relative;
	z-index: 1;
	flex-shrink: 0;
	width: 100%;
	padding: 16px 16px;
	padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	padding-left: calc(16px + env(safe-area-inset-left, 0px));
	padding-right: calc(16px + env(safe-area-inset-right, 0px));
	text-align: center;
	background: transparent;
}

.site-footer .p-small {
	margin: 0;
	font-size: 12px;
	color: #8E8E98;
	line-height: 1.6;
	word-break: break-all;
}

.site-footer .p-small a {
	color: #8E8E98;
	text-decoration: none;
	transition: color 0.2s;
}

.site-footer .p-small a:hover {
	color: #1a1a24;
}

/* Footer — Tablet */
@media screen and (min-width: 600px) {
	.site-footer {
		padding: 20px 16px;
	}

	.site-footer .p-small {
		font-size: 13px;
	}
}

/* Footer — Desktop */
@media screen and (min-width: 900px) {
	.site-footer {
		padding: 24px 16px;
	}

	.site-footer .p-small {
		font-size: 14px;
	}
}