/* v3m: 全站手机排版统一修正（多机型 320–430px，苹果/安卓/微信内置浏览器）。放在所有样式表最后加载，桌面端不受影响。 */

/* —— 0 通用：窄屏安全、孤字处理 —— */
@media(max-width:800px){
 html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
 body{overflow-wrap:break-word}
 img,video{max-width:100%}
 li,figcaption,.card-copy p,.ed-project-caption p,.hyc-card p,.rfq-list span,.footer-brand p{text-wrap:balance}
 h1,h2,h3,h4{overflow-wrap:break-word}
}

/* —— 1 「报价查询」六张资料卡：序号不再叠在标题上；窄屏单列，宽屏两列 —— */
@media(max-width:800px){
 .rfq-list{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
 .rfq-list li{display:block;padding:14px 16px 16px!important;border-radius:6px;min-width:0}
 .rfq-list li:before{position:static!important;display:block;margin:0 0 6px;font-size:12px;line-height:1;letter-spacing:.12em;font-weight:700;color:#8a7a4a}
 .rfq-list b{display:block;margin:0 0 4px;font-size:16px;line-height:1.4}
 .rfq-list span{display:block;font-size:13px!important;line-height:1.6!important;color:#55606a;word-break:keep-all!important;overflow-wrap:anywhere!important}
}
@media(max-width:520px){
 .rfq-list{grid-template-columns:1fr!important;gap:10px!important}
 .rfq-list li{display:grid;grid-template-columns:30px minmax(0,1fr);column-gap:10px;align-items:start;padding:14px 16px!important}
 .rfq-list li:before{grid-row:1/3;margin:3px 0 0;font-size:13px;letter-spacing:.06em}
 .rfq-list b{grid-column:2;margin:0 0 3px}
 .rfq-list span{grid-column:2;font-size:13.5px!important}
}

/* —— 2 首页精选案例大图：竖图不再两边留灰，改为竖向取景；其余卡片统一铺满 —— */
@media(max-width:800px){
 .ed-feature-main .ed-photo{aspect-ratio:4/5!important;height:auto!important;background:#17252e}
 .ed-feature-main[href*="case-p08"] .ed-photo{aspect-ratio:4/5!important}
 .ed-feature-main .ed-photo img{width:100%!important;height:100%!important;object-fit:cover!important;object-position:50% 40%!important;position:static}
 .ed-feature-main:not([href*="case-p08"]) .ed-photo{aspect-ratio:4/3!important}
 .ed-feature-side .ed-photo img,.ed-secondary-grid .ed-photo img{width:100%!important;height:100%!important;object-fit:cover!important;position:static}
 .ed-feature-side .ed-project[href*="case-p13"] .ed-photo,.ed-feature-side .ed-project[href*="case-p21"] .ed-photo{aspect-ratio:1/1!important;height:auto!important}
 .ed-secondary-grid .ed-photo{aspect-ratio:4/5!important}
 .ed-secondary-grid{grid-auto-columns:min(62%,260px)!important}
 .ed-feature-main .ed-project-caption{padding-top:12px}
}

/* —— 3 页脚：标语不再拆出孤字；底部留白交给页脚本身，去掉多余灰块 —— */
@media(max-width:800px){
 footer{padding:34px 0 28px!important}
 .footer-grid{display:grid!important;grid-template-columns:1fr!important;gap:26px!important}
 .footer-grid>div:last-child{grid-column:auto!important}
 .footer-brand{display:grid;grid-template-columns:48px minmax(0,1fr);column-gap:14px;align-items:center}
 .footer-brand img{width:48px!important;height:48px!important;margin:0!important;grid-row:1/3}
 .footer-brand h3{margin:0!important;font-size:19px;line-height:1.3}
 .footer-brand p{margin:2px 0 0!important;font-size:13px;line-height:1.5;grid-column:2;text-wrap:balance}
 .footer-grid>div:nth-child(2){display:grid;grid-template-columns:1fr 1fr;column-gap:20px}
 .footer-grid>div:nth-child(2) h4{grid-column:1/-1;margin:0 0 6px}
 .footer-grid>div:nth-child(2)>a{margin:0!important;padding:8px 0;font-size:14px!important;line-height:1.4}
 .footer-grid h4{font-size:14px;margin-bottom:10px}
 .footer-grid>div:last-child p{font-size:13px;line-height:1.6;margin:0 0 8px}
 .footer-grid .text-link{display:inline-block;margin-top:6px;font-size:14px;color:#1d2328;border-bottom:1px solid #b9c2c8}
 .footer-grid .preview-note{margin:10px 0 0!important}
 .footer-grid .preview-note a{font-size:14px;color:#3c454c;overflow-wrap:anywhere}
 .footer-bottom{margin-top:26px!important;padding-top:16px!important;padding-bottom:0!important;font-size:12px!important;line-height:1.6;color:#5b6670;display:block;padding-right:0!important}
 .footer-bottom span{display:block;margin-top:2px}
}
/* 底部固定按钮栏（≤760px 显示）：页面末尾留出按钮栏高度 + 安全区，内容不被遮挡 */
@media(max-width:760px){
 body{padding-bottom:0!important}
 footer{padding-bottom:calc(63px + env(safe-area-inset-bottom,0px) + 22px)!important}
 .m-bar{padding-bottom:calc(8px + env(safe-area-inset-bottom,0px))}
 .hy-toast{bottom:calc(76px + env(safe-area-inset-bottom,0px))}
}

/* —— 4 首图图注：深色底衬 + 白字，任何图上都清楚 —— */
@media(max-width:800px){
 .ed-hero .ed-hero-caption{display:block!important;max-width:min(62vw,240px);padding:7px 10px!important;border-left:2px solid #c9a43a!important;border-radius:2px;background:rgba(11,20,26,.68);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);color:#fff!important;text-shadow:none!important;text-align:left!important}
 .ed-hero .ed-hero-caption span{display:block;font-size:12px!important;line-height:1.4;color:#fff;opacity:1!important;font-weight:600}
 .ed-hero .ed-hero-caption small{display:block;font-size:11px!important;line-height:1.4;margin-top:2px!important;color:#e3e8eb!important;letter-spacing:.02em}
}

/* —— 5 手机菜单展开：下方内容压暗，点空白处收起 —— */
@media(max-width:1200px){
 body:has(.menu-toggle[aria-expanded="true"])::after{content:"";position:fixed;left:0;right:0;bottom:0;top:0;z-index:19;background:rgba(10,16,20,.55);animation:v3mfade .2s ease both}
 body:has(.menu-toggle[aria-expanded="true"]) .m-bar{opacity:.35;pointer-events:none}
 @keyframes v3mfade{from{opacity:0}to{opacity:1}}
}

/* —— 6 其他版式 —— */
@media(max-width:800px){
 /* 型材拉弯页：设备图高度写死导致图注盖住下一节标题 */
 .bending-start .bending-equipment>img{height:auto!important;max-height:none}
 .bending-start .bending-equipment figcaption span{white-space:normal!important}
 /* 项目卡片 2 列时，最后一张落单则整行铺开 */
 .project-grid>.project-card:last-child:nth-child(odd){grid-column:1/-1!important}
 .project-grid>.project-card:last-child:nth-child(odd) .project-visual{aspect-ratio:16/9!important;height:auto!important}
 .project-grid>.project-card:last-child:nth-child(odd) .project-visual img{width:100%;height:100%;object-fit:cover}
}

/* —— 7 联系页：邮箱、卡片文字窄屏不断成孤字 —— */
@media(max-width:820px){
 .hyc-mail .hyc-val,.hyc-val.hyc-email{font-size:clamp(15px,4.9vw,19px)!important;word-break:normal!important;overflow-wrap:anywhere;letter-spacing:0}
 .hyc-card{padding:18px 18px 18px 20px}
 .hyc-info li,.hyc-info p{text-wrap:balance}
}

/* —— 8 标题换行：中文标题不再因 keep-all 被拆成「末行 1–2 个字」，改为均衡折行 —— */
@media(max-width:800px){
 h2,h3,h4,.card-copy h3,.ed-project-caption h3,.ed-experience-grid h3,.ed-factory h3,.ed-factory li,.qa b{word-break:normal!important;text-wrap:balance}
 h1{word-break:keep-all;text-wrap:balance}
 .ed-hero h1{word-break:keep-all!important}
}

/* —— 9 项目卡片图：统一 4:3 取景铺满，不再出现四周灰蓝留白 —— */
@media(max-width:800px){
 .project-card .project-visual{aspect-ratio:4/3!important;height:auto!important;overflow:hidden;background:#e9eef0}
 .project-card .project-visual>img{width:100%!important;height:100%!important;object-fit:cover!important;object-position:50% 45%!important;display:block}
}

/* —— 10 关于页图集：奇数张时最后一张整行铺开，不再落单 —— */
@media(max-width:800px){
 .v2q-grid{grid-template-columns:1fr 1fr!important}
 .v2q-grid:not(:has(.v2q-wide))>.v2q-fig:last-child:nth-child(odd),.v2q-grid:has(.v2q-wide)>.v2q-fig:last-child:nth-child(even){grid-column:1/-1}
 .v2q-grid:not(:has(.v2q-wide))>.v2q-fig:last-child:nth-child(odd) a,.v2q-grid:has(.v2q-wide)>.v2q-fig:last-child:nth-child(even) a{aspect-ratio:16/9}
}

/* —— 11 联系页「你的工程在哪里」地区标签：三等分，不再换行落单 —— */
@media(max-width:800px){
 .v2d-region{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));column-gap:8px}
 .v2d-region>h2,.v2d-region>.v2d-rp{grid-column:1/-1}
 .v2d-region>label{display:flex;align-items:center;justify-content:center;text-align:center;min-height:42px;padding:6px 6px!important;margin:0 0 14px!important;font-size:14px;line-height:1.25;text-wrap:balance}
}

/* —— 12 段落与案例页标题：末行不留 1–2 个字 —— */
@media(max-width:800px){
 .region-summary p,.card-copy p{text-wrap:balance}
 .v2e-case-head h1,.v2e-case-head h2{word-break:normal!important}
}
.nw{white-space:nowrap}
@media(max-width:800px){
 main strong,.known-item span,.known-item strong{word-break:normal!important;text-wrap:balance}
}
@media(max-width:800px){
 .ed-factory a{text-wrap:balance;word-break:normal!important}
}

/* 联系页卡片文字：中文按标点分行（不在词中间断开），再均衡折行 */
@media(max-width:820px){
 .hyc-card h3,.hyc-card p,.hyc-info li,.hyc-info p,.hyc-info h3,.hyc-wx strong{word-break:keep-all!important;overflow-wrap:anywhere;text-wrap:balance}
}
@media(max-width:820px){.hyc-co p{word-break:normal!important;text-wrap:balance}}
