/* =========================================================
   HAJOMECH 响应式适配（在 theme.css 之后加载）
   断点：≤1024 平板/手机横屏启用汉堡菜单；≤640 手机竖屏单列
   ========================================================= */

/* ---------- 汉堡按钮与抽屉菜单（桌面端隐藏） ---------- */
#m-btn{display:none;}
#m-panel{display:none;}

@media (max-width: 1024px){

	/* ===== 全局 ===== */
	/* html 也必须裁横向溢出：只设 body 时，手机浏览器的 shrink-to-fit
	   仍会把布局视口撑宽，导致整页缩小、两侧留白 */
	html,body{overflow-x:hidden;max-width:100%;}
	.wrapper{width:auto;max-width:1400px;padding:0 16px;box-sizing:border-box;}
	img{max-width:100%;height:auto;}
	.title h2{font-size:22px;}

	/* 头部内部容器在原站是 0 高度浮动容器，放行子元素即可 */
	#header .yemei{height:auto;overflow:visible;}

	/* ===== 头部 ===== */
	#header{height:70px;position:relative;}
	#logo{position:static;float:left;height:70px;display:flex;align-items:center;}
	#logo img{width:auto;height:52px;}
	#nav,#search,#language{display:none;}

	#m-btn{display:block;position:absolute;right:12px;top:50%;margin-top:-19px;width:38px;height:38px;padding:9px 8px;background:none;border:0;cursor:pointer;z-index:1002;}
	#m-btn span{display:block;height:3px;margin:4px 0;background:#fff;border-radius:2px;transition:transform .25s,opacity .25s;}
	body.m-nav-open #m-btn span:nth-child(1){transform:translateY(7px) rotate(45deg);}
	body.m-nav-open #m-btn span:nth-child(2){opacity:0;}
	body.m-nav-open #m-btn span:nth-child(3){transform:translateY(-7px) rotate(-45deg);}

	#m-panel{display:none;position:absolute;left:0;right:0;top:70px;max-height:calc(100vh - 70px);overflow-y:auto;background:#fff;box-shadow:0 8px 16px rgba(0,0,0,.15);z-index:1001;}
	body.m-nav-open #m-panel{display:block;}

	#m-panel .m-search{padding:12px 16px;border-bottom:1px solid #eee;}
	#m-panel .m-search form{position:relative;}
	#m-panel .m-search input{width:100%;height:36px;padding:0 40px 0 12px;border:1px solid #ddd;border-radius:18px;box-sizing:border-box;font-size:14px;outline:none;}
	#m-panel .m-search button{position:absolute;right:4px;top:4px;width:28px;height:28px;border:0;background:url(img/search.png) no-repeat center #fff;background-size:14px;cursor:pointer;}

	#m-panel .m-list li{position:relative;border-bottom:1px solid #f0f0f0;}
	#m-panel .m-list li > a{display:block;padding:13px 52px 13px 20px;color:#333;font-size:15px;text-decoration:none;}
	#m-panel .m-list li.current > a{color:#0f56b2;font-weight:bold;}
	#m-panel .m-list li.m-has-sub > a{padding-right:52px;}
	#m-panel .m-arrow{position:absolute;right:0;top:0;width:52px;height:47px;cursor:pointer;}
	#m-panel .m-arrow:before,#m-panel .m-arrow:after{content:"";position:absolute;left:50%;top:50%;width:14px;height:2px;background:#999;transform:translate(-50%,-50%);}
	#m-panel .m-arrow:after{transform:translate(-50%,-50%) rotate(90deg);transition:transform .2s;}
	#m-panel li.m-open .m-arrow:after{transform:translate(-50%,-50%) rotate(0deg);}

	/* 折叠的二级菜单（兼容 dl.erji 结构） */
	#m-panel .erji{display:none;position:static;width:auto;padding:0 0 6px;background:#f8f8f8;}
	#m-panel .erji dd{float:none;background:none;padding:0;line-height:normal;}
	#m-panel .erji dd a{color:#555;padding:10px 20px 10px 34px;display:block;text-decoration:none;}
	#m-panel .erji dd p{background:none;padding-left:0;font-size:13px;color:#555;}
	#m-panel .erji dd:hover{background:#eef4fc;}

	/* 语言切换 */
	#m-panel .m-lang{display:flex;border-top:6px solid #f2f2f2;}
	#m-panel .m-lang a{flex:1;text-align:center;padding:13px 0;color:#0f56b2;font-size:14px;text-decoration:none;}
	#m-panel .m-lang a + a{border-left:1px solid #eee;}

	/* ===== 首页 Banner ===== */
	/* 原站把背景钉死为 background-size:auto 100%（按高度缩放），
	   手机上横向会裁掉大半；改为 cover 居中，主体不偏移 */
	#banner,#banner-img,#banner-img ul li,#banner-img ul li a{height:52vw;max-height:420px;}
	#banner-img{overflow:hidden;}
	#banner-img ul li{background-size:cover !important;background-position:center center !important;}
	#banner-btn{bottom:16px;}

	/* ===== 产品（保留轮播，卡片自适应） ===== */
	#product{padding:40px 0;}
	#product-item,#product-item ul li{height:auto;}
	#product-item ul li{width:100%;}
	#product-item ul li dl{margin-left:-12px;}
	#product-item ul li dl dd{width:calc(33.333% - 12px);margin-left:12px;height:auto;}
	#product-item ul li dl dd img{width:100%;height:auto;display:block;}
	#product-item ul li dl dd section{height:auto;padding:14px 16px;}
	#product-item ul li dl dd section h3{height:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
	#product-item ul li dl dd section p{height:auto;line-height:24px;margin-top:6px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
	#product-item ul li dl dd h4{display:none;}

	/* ===== 关于我们 ===== */
	#about{padding:40px 0;max-height:none;}
	#about-text,#about-img{width:100%;height:auto;padding:30px;box-sizing:border-box;}
	#about-text section{height:auto;max-height:none;}
	#about-text h4{margin-top:24px;margin-bottom:10px;}
	#about-img{margin-top:20px;position:relative;}
	#about-img img{width:100%;height:auto;display:block;}
	#about-img h3{bottom:20px;}

	/* ===== 案例 ===== */
	#case{padding:40px 0;}
	#case-item ul{margin:-12px 0 0 -12px;}
	#case-item ul li{width:calc(50% - 12px);height:auto;margin:12px 0 0 12px;}
	#case-item ul li img{width:46%;height:auto;}
	#case-item ul li section{width:54%;height:auto;box-sizing:border-box;border-left:none;min-height:200px;}

	/* 首页「经典案例」大图列表（原站固定 446px，是手机横向溢出的元凶） */
	#xcase ul{margin:-12px 0 0 -12px;}
	#xcase ul li{width:calc(50% - 12px);height:auto;margin:12px 0 0 12px;}
	#xcase ul li img{width:100%;height:auto;}
	#xcase ul li h3{line-height:normal;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;text-align:center;white-space:normal;}

	/* ===== 人力资源 ===== */
	#mgt{padding:40px 0;max-height:none;}
	#mgt-item dl{margin-left:-12px;}
	#mgt-item dl dd{width:calc(33.333% - 12px);margin-left:12px;height:auto;padding:24px 16px;box-sizing:border-box;}
	#mgt-item dl dd p{height:auto;line-height:24px;margin-top:14px;}

	/* ===== 新闻 ===== */
	#press{padding:40px 0;max-height:none;}
	#press-item{width:100%;height:auto;padding:12px;box-sizing:border-box;}
	#press-item ul li,#press-list ul li{height:auto;padding-bottom:14px;}
	#press-item ul li figure,#press-list ul li figure{width:calc(100% - 92px);height:auto;}
	#press-item ul li figure p,#press-list ul li figure p{height:auto;line-height:22px;margin-top:8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
	#press-rmd{width:100%;height:auto;margin-top:20px;}
	#press-rmd img{width:100%;height:auto;}

	/* ===== 页脚 & 留言 ===== */
	#footer{padding:40px 0 16px;}
	#footer dl{width:33.33%;margin-bottom:14px;}
	#f-contact{width:100% !important;margin-right:0 !important;}
	#copyright{height:auto;line-height:24px;padding:10px 0;}
	#copyright .cr-left,#copyright .cr-right{float:none !important;text-align:center;margin:0;line-height:24px;}
	#copyright .cr-right{margin-top:6px;}
	#copyright .cr-right .hj-beian-link + .hj-beian-link{margin-left:16px;}
	.biaoge li{flex-wrap:wrap;gap:10px 0;}
	.biaoge input,.biaoge textarea{width:100% !important;box-sizing:border-box;margin:0 !important;}

	/* ===== 内页 ===== */
	.banner2,.banner2 li{height:38vw;max-height:500px;min-height:180px;}
	.banner2 li{background-position:center center !important;}
	#menu{height:auto;}
	#menu .wrapper{overflow-x:auto;-webkit-overflow-scrolling:touch;}
	#menu dl dd{float:none;display:inline-block;white-space:nowrap;}
	#crumbs{padding:10px 0 0;}
	#single h4,#single h5{width:100%;float:none;}
	#single table{display:block;max-width:100%;overflow-x:auto;}
	#pageinfo{padding:20px 0;}

	/* 悬浮企业微信缩小（页面不再横向溢出后，fixed 图标稳定贴屏） */
	body .weixin{width:36px !important;height:36px !important;right:12px !important;top:auto !important;bottom:88px !important;z-index:900;}
	body .weixin .lx{width:36px !important;height:36px !important;}
	body .weixin:hover{width:40px !important;height:40px !important;}
}

@media (max-width: 640px){

	/* ===== 手机竖屏：单列 ===== */
	#logo img{height:44px;}
	#header{height:60px;}
	#m-panel{top:60px;max-height:calc(100vh - 60px);}

	.title h2{font-size:20px;}

	/* Banner */
	#banner,#banner-img,#banner-img ul li,#banner-img ul li a{height:64vw;max-height:420px;min-height:220px;}

	/* 产品：一屏一个，纵向排列 */
	#product-item ul li dl dd{width:100%;}
	#product-item ul li dl dd section p{-webkit-line-clamp:3;}

	/* 关于 */
	#about-text{padding:22px;}
	#about-text section{line-height:26px;font-size:14px;}

	/* 案例：单列，图上文下 */
	#case-item ul li{width:100%;}
	#case-item ul li img{width:100%;float:none;display:block;}
	#case-item ul li section{width:100%;float:none;border-left:1px solid #e1e1e1;min-height:0;}
	#xcase ul li{width:100%;}

	/* 人力资源：单列 */
	#mgt-item dl dd{width:100%;padding:26px 20px;}
	#mgt-item dl dd h3{margin-top:18px;}
	#mgt-item dl dd p{margin-top:12px;}

	/* 新闻日期块缩小 */
	#press-item ul li section,#press-list ul li section{width:64px;height:42px;padding:12px 0;}
	#press-item ul li figure,#press-list ul li figure{width:calc(100% - 74px);}

	/* 页脚：两列 */
	#footer dl{width:50%;}

	/* 表单：标签间距 */
	.biaoge{padding:14px;}
	.tijiao{width:100%;}
}

/* 桌面端兜底：≥1025px 恢复原生布局（防止旧缓存） */
@media (min-width: 1025px){
	#m-panel{display:none !important;}
}
