/* =========================================================
   智绘嘉AI 全站页面主体布局修复层 V1.0
   作用：统一页面居中、iPad自适应、主体不再被压缩。
   注意：不接管已拆分的PC/手机导航，只修正文档主体区域。
   ========================================================= */

:root{
  --zhj-sidebar-space:50px;       /* PC统一导航占位：当前按折叠侧栏50px处理 */
  --zhj-page-max:1500px;
  --zhj-tool-max:1760px;
  --zhj-page-pad:clamp(16px,2.2vw,32px);
}

html,body{max-width:100%;overflow-x:hidden!important;}
*,*::before,*::after{box-sizing:border-box;}
img,video,canvas,svg{max-width:100%;height:auto;}

body.zhj-split-page{min-width:0!important;}

/* =========================
   PC端：主体在导航右侧空间内居中
   ========================= */
@media (min-width:921px){
  body.zhj-split-page:not(.zhj-hero-page) main,
  body.zhj-split-page:not(.zhj-hero-page) footer,
  body.zhj-split-page:not(.zhj-hero-page) .zhj-main,
  body.zhj-split-page:not(.zhj-hero-page) .page-main,
  body.zhj-split-page:not(.zhj-hero-page) .app-main{
    margin-left:var(--zhj-sidebar-space)!important;
    width:calc(100% - var(--zhj-sidebar-space))!important;
    max-width:none!important;
  }

  body.zhj-split-page:not(.zhj-hero-page) main > .container,
  body.zhj-split-page:not(.zhj-hero-page) main > .max-w-7xl,
  body.zhj-split-page:not(.zhj-hero-page) main > .max-w-6xl,
  body.zhj-split-page:not(.zhj-hero-page) main > .max-w-5xl,
  body.zhj-split-page:not(.zhj-hero-page) .page-container,
  body.zhj-split-page:not(.zhj-hero-page) .zhj-page-container{
    margin-left:auto!important;
    margin-right:auto!important;
  }
}

/* =========================
   普通内容页：统一最大宽度和居中
   ========================= */
body.zhj-content-page main,
body.zhj-project-page main,
body.zhj-user-page main,
body.zhj-vip-page main{
  min-width:0!important;
}

body.zhj-content-page main > section,
body.zhj-content-page main > div,
body.zhj-vip-page main > section,
body.zhj-vip-page main > div,
body.zhj-user-page main > section,
body.zhj-user-page main > div,
body.zhj-project-page main > section,
body.zhj-project-page main > div{
  max-width:var(--zhj-page-max);
  margin-left:auto!important;
  margin-right:auto!important;
}

/* =========================
   5个热门工具：工作台居中 + iPad不压成一团
   ========================= */
body.zhj-tool-page .space-workbench,
body.zhj-tool-page .tool-workbench,
body.zhj-tool-page .zhj-tool-workbench{
  width:100%!important;
  max-width:var(--zhj-tool-max)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  padding-left:var(--zhj-page-pad)!important;
  padding-right:var(--zhj-page-pad)!important;
}

body.zhj-tool-page .space-layout,
body.zhj-tool-page .tool-layout,
body.zhj-tool-page .zhj-tool-layout{
  min-width:0!important;
}

body.zhj-tool-page .space-card,
body.zhj-tool-page .space-result-card,
body.zhj-tool-page .tool-card,
body.zhj-tool-page .result-card{
  min-width:0!important;
  max-width:100%!important;
}

body.zhj-tool-page #resultBox,
body.zhj-tool-page .result-box,
body.zhj-tool-page .zhj-final-result-img{
  max-width:100%!important;
}

/* iPad / 平板：工具区改为上下结构，避免左右两栏互相挤压 */
@media (min-width:769px) and (max-width:1180px){
  body.zhj-tool-page main,
  body.zhj-tool-page footer{
    margin-left:0!important;
    width:100%!important;
  }
  body.zhj-tool-page .space-workbench,
  body.zhj-tool-page .tool-workbench,
  body.zhj-tool-page .zhj-tool-workbench{
    max-width:920px!important;
    padding-left:24px!important;
    padding-right:24px!important;
    padding-top:92px!important;
  }
  body.zhj-tool-page .space-layout,
  body.zhj-tool-page .tool-layout,
  body.zhj-tool-page .zhj-tool-layout{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:22px!important;
  }
  body.zhj-tool-page .space-result-card,
  body.zhj-tool-page .result-card{
    position:relative!important;
    top:auto!important;
  }
  body.zhj-tool-page .space-hero{
    text-align:center!important;
  }
}

/* 手机：主体全宽，顶部给手机导航留安全距离 */
@media (max-width:768px){
  body.zhj-split-page:not(.zhj-hero-page) main,
  body.zhj-split-page:not(.zhj-hero-page) footer,
  body.zhj-split-page:not(.zhj-hero-page) .zhj-main{
    margin-left:0!important;
    width:100%!important;
    max-width:100%!important;
  }
  body.zhj-tool-page .space-workbench,
  body.zhj-tool-page .tool-workbench,
  body.zhj-tool-page .zhj-tool-workbench{
    max-width:100%!important;
    padding-left:14px!important;
    padding-right:14px!important;
  }
}

/* =========================
   Hero首页：iPad专用，不让大标题/五宫格压缩
   ========================= */
@media (min-width:769px) and (max-width:1180px){
  body.zhj-hero-page html,
  body.zhj-hero-page{
    overflow:hidden!important;
  }
  body.zhj-hero-page .zhj-hero-nav{
    height:72px!important;
    padding-left:22px!important;
    padding-right:22px!important;
    grid-template-columns:210px 1fr 170px!important;
  }
  body.zhj-hero-page .zhj-hero-logo img{width:190px!important;}
  body.zhj-hero-page .zhj-hero-menu{gap:22px!important;}
  body.zhj-hero-page .zhj-hero-menu a{font-size:15px!important;transform:none!important;}
  body.zhj-hero-page .zhj-service{font-size:20px!important;}
  body.zhj-hero-page .zhj-avatar-btn{width:46px!important;height:46px!important;}
  body.zhj-hero-page .zhj-main{
    padding-top:96px!important;
    padding-left:24px!important;
    padding-right:24px!important;
    width:100%!important;
    max-width:100%!important;
  }
  body.zhj-hero-page .zhj-symbol-stage{
    width:260px!important;
    height:230px!important;
    margin-bottom:4px!important;
  }
  body.zhj-hero-page .zhj-ring.r1,
  body.zhj-hero-page .zhj-dot.d1{width:250px!important;height:250px!important;}
  body.zhj-hero-page .zhj-ring.r2,
  body.zhj-hero-page .zhj-dot.d2{width:188px!important;height:188px!important;}
  body.zhj-hero-page .zhj-dot.d3{width:220px!important;height:220px!important;}
  body.zhj-hero-page .zhj-symbol{width:190px!important;}
  body.zhj-hero-page .zhj-title{font-size:64px!important;letter-spacing:.04em!important;}
  body.zhj-hero-page .zhj-text-wrap{width:min(720px,92vw)!important;}
  body.zhj-hero-page .zhj-sub{font-size:30px!important;text-align:center!important;text-align-last:center!important;}
  body.zhj-hero-page .zhj-en{font-size:24px!important;text-align:center!important;text-align-last:center!important;}
  body.zhj-hero-page .zhj-slogan{font-size:24px!important;white-space:normal!important;}
  body.zhj-hero-page .zhj-buttons{margin-top:24px!important;gap:22px!important;}
  body.zhj-hero-page .zhj-btn{height:52px!important;min-width:168px!important;font-size:18px!important;}
  body.zhj-hero-page .zhj-features{
    width:min(920px,92vw)!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:14px!important;
    bottom:24px!important;
  }
  body.zhj-hero-page .zhj-card{min-height:86px!important;padding:14px!important;gap:14px!important;}
  body.zhj-hero-page .zhj-card i{width:42px!important;height:42px!important;font-size:24px!important;}
  body.zhj-hero-page .zhj-card b{font-size:16px!important;margin-bottom:3px!important;}
  body.zhj-hero-page .zhj-card p{font-size:12px!important;white-space:normal!important;}
}

/* iPad横屏高度不够时，隐藏底部卡片，保证核心入口不挤 */
@media (min-width:769px) and (max-width:1180px) and (max-height:820px){
  body.zhj-hero-page .zhj-main{padding-top:88px!important;}
  body.zhj-hero-page .zhj-symbol-stage{width:220px!important;height:190px!important;}
  body.zhj-hero-page .zhj-symbol{width:164px!important;}
  body.zhj-hero-page .zhj-title{font-size:56px!important;}
  body.zhj-hero-page .zhj-sub{font-size:26px!important;}
  body.zhj-hero-page .zhj-en{font-size:21px!important;}
  body.zhj-hero-page .zhj-slogan{font-size:21px!important;margin-top:10px!important;}
  body.zhj-hero-page .zhj-buttons{margin-top:18px!important;}
  body.zhj-hero-page .zhj-features{display:none!important;}
}

/* 防止常见大容器写死宽度导致横向跑偏 */
body.zhj-split-page .container,
body.zhj-split-page .wrapper,
body.zhj-split-page .content,
body.zhj-split-page .page-wrap,
body.zhj-split-page .main-wrap{
  min-width:0;
}
