/**
 * 全站移动端：字号略缩、防横向溢出、头尾与主内容区适配（<640px，与 Tailwind sm 断点一致）
 */

@media (max-width: 639.98px) {
	/* 整页正文字体略小（约 15px 相对 16px） */
	html {
		-webkit-text-size-adjust: 100%;
		overflow-x: hidden;
	}
	body {
		font-size: 0.9375rem;
		line-height: 1.55;
	}

	/* 长词与链接换行，减少横向滚动 */
	#main-content,
	#colophon,
	.lv-site-header {
		overflow-x: hidden;
		max-width: 100%;
	}
	#main-content a,
	#colophon a {
		word-wrap: break-word;
		overflow-wrap: anywhere;
	}

	/* 主区标题：比桌面再收一档（与 theme-style 中 clamp 叠加） */
	#main-content > article > h1,
	#main-content h1.entry-title,
	.srch-pg__results-title {
		font-size: clamp(1.05rem, 4.2vw, 1.4rem);
		line-height: 1.25;
	}
	#main-content:not(.jg-page) h2 {
		font-size: clamp(1rem, 3.6vw, 1.35rem);
		line-height: 1.15;
	}
	#main-content:not(.jg-page) h3 {
		font-size: clamp(0.9rem, 3.1vw, 1.1rem);
		line-height: 1.15;
	}
	#main-content:not(.jg-page) h4 {
		font-size: clamp(0.88rem, 2.5vw, 0.95rem);
	}
	#main-content:not(.jg-page) h5,
	#main-content:not(.jg-page) h6 {
		font-size: clamp(0.8rem, 2.2vw, 0.9rem);
	}

	/* style.css 中固定 px 的 entry 标题，移动端改为 rem 略小 */
	.page-content h1,
	.entry-content h1 {
		font-size: 1.25rem;
	}
	.page-content h2,
	.entry-content h2 {
		font-size: 1.15rem;
	}
	.page-content h3,
	.entry-content h3 {
		font-size: 1.05rem;
	}
	.page-content h4,
	.entry-content h4 {
		font-size: 0.95rem;
	}
	.entry-content h5,
	.entry-content h6,
	.page-content h5,
	.page-content h6 {
		font-size: 0.9rem;
	}
	.entry-content,
	.page-content,
	.entry-content p,
	.page-content p,
	.entry-content li,
	.page-content li {
		font-size: 0.9375rem;
		line-height: 1.6;
	}

	/* 内嵌媒体不撑破 */
	.entry-content img,
	.page-content img,
	.wp-block-image img,
	#main-content img {
		max-width: 100%;
		height: auto;
	}
	.entry-content pre,
	.page-content pre {
		max-width: 100%;
		overflow-x: auto;
		font-size: 0.8rem;
	}
	.entry-content table,
	.page-content table {
		display: block;
		max-width: 100%;
		overflow-x: auto;
		font-size: 0.8125rem;
	}

	/* 顶栏与移动菜单 */
	#lv-nav-mobile a,
	.lv-mobile-nav a,
	#mobile-nav a {
		font-size: 0.9375rem;
		display: block;
		padding: 0.65rem 0;
		min-height: 2.75rem;
		box-sizing: border-box;
	}
	#mobile-nav,
	.lv-mobile-nav {
		padding-top: 0.75rem;
		padding-bottom: 0.75rem;
	}

	/* 页脚 */
	#colophon p,
	#colophon a,
	#colophon .lv-footer-menu a {
		font-size: 0.8125rem;
		line-height: 1.5;
	}
	.lv-site-footer__grid {
		padding-bottom: max(2.75rem, calc(1.5rem + env(safe-area-inset-bottom, 0px)));
	}

	/* 评论区 */
	.comments-area,
	.comment-content,
	.comment-content p,
	.comment-list .fn,
	.comment-body {
		font-size: 0.875rem;
		line-height: 1.55;
	}
	.comment-meta,
	.comment-metadata,
	.comment .reply a {
		font-size: 0.75rem;
	}
	.comment-respond,
	.comment-respond label,
	.comment-respond .comment-form p {
		font-size: 0.875rem;
	}
	.comment-respond .form-submit input,
	.comment-respond input[type="submit"] {
		font-size: 0.875rem;
		padding: 0.4rem 0.9rem;
	}

	/* 顶栏 CTA：窄屏压缩，避免与汉堡按钮抢宽度 */
	.lv-site-header .lv-header-claim {
		padding: 0.45rem 0.65rem;
		font-size: 0.75rem;
		letter-spacing: 0.01em;
		max-width: 42vw;
		text-align: center;
		line-height: 1.15;
	}

	/* 移动菜单：长菜单可滚动，避免超出视口 */
	#mobile-nav.lv-mobile-nav:not(.hidden) {
		max-height: min(72vh, 24rem);
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}
	#main-content.jg-page .jg-home-hero {
		min-height: 0;
		align-items: flex-start;
		padding-top: 2.25rem;
		padding-bottom: 2.75rem;
	}
	#main-content.jg-page .jg-home-hero__title {
		font-size: clamp(1.5rem, 6.8vw, 2.15rem);
		max-width: none;
		line-height: 1.08;
	}
	#main-content.jg-page .jg-home-lead {
		font-size: 0.9375rem;
		line-height: 1.65;
	}
	#main-content.jg-page .jg-home-hero__actions {
		flex-direction: column;
		align-items: stretch;
	}
	#main-content.jg-page .jg-home-btn {
		width: 100%;
		max-width: 22rem;
		align-self: center;
		box-sizing: border-box;
	}
	#main-content.jg-page .jg-home-stat {
		width: 100%;
		max-width: 22rem;
		margin-left: auto;
		margin-right: auto;
	}
	#main-content.jg-page .jg-home-eyebrow {
		letter-spacing: 0.12em;
	}

	/* 首页长段落 / 营销词防撑破 */
	#main-content.jg-page .jg-section-desc,
	#main-content.jg-page .jg-home-deck {
		overflow-wrap: anywhere;
		word-break: break-word;
	}

	/* 静态营销内页（glass section）：标题与正文 */
	#main-content.page:not(.jg-page) h1 {
		font-size: clamp(1.2rem, 5.2vw, 1.85rem);
		line-height: 1.15;
		word-break: break-word;
	}
	#main-content.page:not(.jg-page) h2 {
		font-size: clamp(1.05rem, 4.2vw, 1.45rem);
		line-height: 1.12;
	}
	#main-content.page:not(.jg-page) p,
	#main-content.page:not(.jg-page) li {
		overflow-wrap: anywhere;
	}

	/* 固定页 glass section：避免横向抖动 */
	#main-content.page section {
		box-sizing: border-box;
		max-width: 100%;
	}

	/* 首页 FAQ 展开：小屏加长可用高度 */
	#main-content.jg-page .faq-panel--smooth.open {
		max-height: min(70vh, 28rem);
	}

	/* 刘海屏：顶栏留出安全区 */
	.lv-site-header.lv-site-header--premium {
		padding-top: env(safe-area-inset-top, 0px);
	}
}
