/* ===== 移动端适配 2026-10-28 =====
   为什么单独一个文件：pc-struct.css / pc-index.css 是老站 PC 专用样式，
   直接改它们风险高（首页也在用）。这里用同权重后置覆盖，只在小屏生效。
   目标：不是把 PC 版缩小，而是让手机上能正常读。 */

@media (max-width: 820px){
  /* ---- 顶部导航：92px 固定头在手机上太占屏，压缩并允许横向滚动 ---- */
  #header .space{height:54px;}
  #header .fixed{height:54px;}
  #header .fixed .container{padding:0 10px;gap:6px;}
  #header .log img{height:30px;}
  #header .items{
    height:auto;line-height:1.2;margin:0 6px;
    overflow-x:auto;-webkit-overflow-scrolling:touch;
    gap:14px;justify-content:flex-start;
    scrollbar-width:none;
  }
  #header .items::-webkit-scrollbar{display:none;}
  #header .items .item{font-size:14px;padding:0 2px;white-space:nowrap;}
  /* 电话在手机上收成小字，避免挤掉导航 */
  #header .phone span{font-size:13px;white-space:nowrap;}
  #header .phone img{width:14px;height:14px;}

  /* ---- 页脚：多列改单列，去掉过大留白 ---- */
  #footer-actions .container{display:block;padding:0 14px;}
  #footer .container{display:block;padding:16px 14px;}
  #footer .box{width:auto !important;float:none !important;margin-bottom:16px;}
  #footer img{max-width:100%;height:auto;}

  /* ---- 通用：表格与长串不撑破屏幕 ---- */
  table{display:block;overflow-x:auto;max-width:100%;}
  pre,code{white-space:pre-wrap;word-break:break-word;}
  img{max-width:100%;height:auto;}
}

@media (max-width: 420px){
  #header .items .item{font-size:13px;}
  #header .items{gap:10px;}
}

/* 2026-10-28 补：上面只给 .items 加了 overflow-x:auto，
   但它的父容器没有限宽，8 个导航项横排 968px 把 html/body 撑到 1200px，
   导致整页横向溢出、正文右侧被裁。
   这里从根上锁死宽度，并让导航条自己滚动。 */
@media (max-width: 820px){
  html,body{max-width:100%;overflow-x:hidden;}
  #header,#header .fixed,#header .fixed .container{max-width:100%;box-sizing:border-box;}
  #header .fixed .container{overflow:hidden;}
  #header .items{max-width:100%;flex-wrap:nowrap;}
  /* 页脚同理 */
  #footer,#footer-actions{max-width:100%;overflow-x:hidden;box-sizing:border-box;}
}

/* ===== 根因修复 2026-10-28 =====
   site.css 里写死了：
     html,body{width:100%;min-width:1200px;}
     .container{width:1200px;}
   这就是手机上整页横向溢出、正文被裁的真正原因。
   必须在媒体查询里把 min-width 干掉，否则后面所有适配都白做。 */
@media (max-width: 820px){
  html,body{min-width:0 !important;width:auto !important;max-width:100% !important;}
  .container{width:auto !important;max-width:100% !important;margin:0 auto !important;padding:0 12px;}
  #app{width:auto !important;overflow:visible;}
}

/* 2026-10-28 补：右侧悬浮咨询条 #consult 在手机上压住正文。
   PC 上 item 是 60x60 + margin 12px，占 84px，390 屏上盖掉正文右侧。
   这里缩小到 44px 并贴边，同时给正文留出安全距离。 */
@media (max-width: 820px){
  #consult{align-items:flex-start;padding-top:70px;}
  #consult .items .item{width:44px;height:44px;margin:4px 6px;border-radius:5px;}
  #consult .items .item img{width:22px;height:22px;}
  #consult .items .item .msg{font-size:11px;}
  /* 正文右侧留出悬浮条宽度，避免被盖 */
  .art-body,.main{padding-right:14px;}
}
@media (max-width: 420px){
  #consult .items .item{width:40px;height:40px;margin:3px 5px;}
  #consult .items .item img{width:20px;height:20px;}
}

/* ===== 侧栏移动端改造 2026-10-28 =====
   问题：PC 侧栏 3 个盒子 19 个链接，手机上下沉到正文之后全平铺，
   又长又乱，页面底部像"链接垃圾场"。
   方案（参考移动端通行做法）：改成手风琴折叠，默认收起，点标题展开。
   桌面端保持原样（summary 隐藏、始终展开）。 */

/* 桌面端：details 渲染成原来的盒子，不显示折叠箭头 */
.side details.box{background:#fff;border-radius:6px;padding:20px;
  box-shadow:0 2px 12px rgba(0,0,0,0.06);margin-bottom:20px;}
.side details.box summary{list-style:none;cursor:default;display:block;}
.side details.box summary::-webkit-details-marker{display:none;}
.side details.box summary::marker{content:"";}
.side details.box summary h3{font-size:16px;color:#303133;padding-bottom:10px;
  border-bottom:1px solid #ebeef5;margin-bottom:10px;font-weight:normal;}
.side details.box ul{list-style:none;}
.side details.box li{padding:6px 0;font-size:14px;}

@media (max-width: 820px){
  /* 手机端：盒子间距收紧，变成可点的折叠条 */
  .side{margin-top:16px;}
  .side details.box{padding:0;border-radius:0;box-shadow:none;margin-bottom:1px;
    background:#fff;border-bottom:1px solid #f0f2f5;}
  .side details.box summary{cursor:pointer;display:flex;align-items:center;
    justify-content:space-between;padding:14px 16px;user-select:none;
    -webkit-tap-highlight-color:transparent;}
  .side details.box summary h3{font-size:15px;color:#303133;margin:0;padding:0;
    border:none;font-weight:600;line-height:1.4;}
  /* 折叠箭头：收起时朝下，展开时朝上 */
  .side details.box summary::after{content:"";width:8px;height:8px;
    border-right:2px solid #c0c4cc;border-bottom:2px solid #c0c4cc;
    transform:rotate(45deg);transition:transform .2s;margin-right:4px;flex:none;}
  .side details.box[open] summary::after{transform:rotate(-135deg);}
  .side details.box[open] summary{border-bottom:1px solid #f0f2f5;}
  /* 展开后的列表：两列排，避免 10 个链接拉成一长条 */
  .side details.box ul{padding:8px 16px 14px;display:grid;
    grid-template-columns:1fr 1fr;gap:0 12px;}
  .side details.box li{padding:7px 0;font-size:14px;border-bottom:1px dashed #f5f7fa;}
  .side details.box li a{display:block;color:#606266;}
  /* 关于充场网只有 2 项，单列更整齐 */
  .side details.box:last-child ul{grid-template-columns:1fr;}
}

/* 2026-10-28 补：手机上默认收起（<details open> 在桌面要保持展开，
   所以不能直接去掉 open，用脚本在小屏时移除）。
   JS 未执行时仍展开，不会丢内容，属渐进增强。 */

/* 2026-10-28 补：侧栏折叠条后面紧跟页脚 logo，没有间距，看着挤。
   给 .side 留底部空白，并让页脚顶部有分隔。 */
@media (max-width: 820px){
  .side{margin-bottom:18px;}
  .side details.box:last-child{border-bottom:none;}
  #footer-actions{border-top:8px solid #f5f7fa;}
}

/* ===== 页脚移动端改造 2026-10-28 =====
   PC 页脚是横向 flex：文字 margin-right:172px、按钮 padding:16px 60px、字号 24px。
   390 屏上全挤爆：文字竖排断行、按钮溢出、二维码和表格错位。
   手机端改成纵向堆叠 + 合理字号。 */

@media (max-width: 820px){
  /* 需求条：竖排，按钮整行 */
  #footer-actions .normal .container,
  #footer-actions .fixed .container{
    display:block;padding:16px 14px;text-align:center;height:auto;}
  #footer-actions .normal > .container > .icon{display:none;}  /* 只隐藏需求条的占位图标 */
  #footer-actions .text{margin:0 0 12px;font-size:15px;line-height:1.6;}
  #footer-actions .text .phone{justify-content:center;font-size:17px;margin-top:4px;}
  #footer-actions .btn{display:inline-block;font-size:15px;padding:10px 28px;
    border-radius:22px;margin:5px 4px;}
  #footer-actions .btn2{margin-left:4px;}
  #footer-actions .fixed{position:static;}

  /* 页脚主体：二维码 + 联系方式竖排 */
  #footer{padding:18px 14px 12px;}
  #footer .container{display:block;padding:0;}
  #footer .data{display:block;text-align:center;}
  #footer .data .qrcode{margin:0 auto 16px;float:none;}
  #footer .data .qrcode img{width:120px;height:120px;}
  #footer .data .qrcode span{display:block;font-size:12px;margin-top:6px;color:#909399;}
  #footer .data .msg{margin:0 auto;text-align:left;max-width:300px;}
  #footer .data .msg .title{font-size:17px;margin-bottom:8px;}
  #footer .data .msg table{width:100%;font-size:13px;}
  #footer .data .msg table td{padding:4px 0;word-break:break-all;}
  #footer .data .msg table td:first-child{width:52px;color:#909399;white-space:nowrap;}
  /* 版权行：小字居中，允许换行 */
  #footer .icp{font-size:11.5px;line-height:1.7;padding:6px 0;text-align:center;
    word-break:break-all;color:#909399;}
}

/* 2026-10-28 补：需求条有两个版本——.normal（文档流）+ .fixed（PC 固定底部）。
   PC 上 .fixed 盖住 .normal 所以只看到一个；手机上我把 .fixed 改成 static，
   结果两个都显示、内容重复。这里只保留 .normal，隐藏 .fixed。 */
@media (max-width: 820px){
  #footer-actions .fixed{display:none !important;}
  #footer-actions .normal{height:auto;}
}

/* 2026-10-28 补：悬浮按钮图标消失。
   原样式 .item 是 60px flex 居中，img 没设宽高靠自然尺寸。
   我把 .item 缩到 44px 后，img 仍是原尺寸被裁掉/溢出。
   这里显式给 .icon img 设尺寸。 */
@media (max-width: 820px){
  /* 用固定尺寸，不用 100%（.item 是 flex 居中、没有显式高度，100% 会算成 0） */
  #consult .items .item .icon{width:22px;height:22px;flex:none;display:block;}
  #consult .items .item .icon img{width:22px;height:22px;display:block;object-fit:contain;}
  /* 悬浮提示浮层在手机上没意义（没有 hover），直接隐藏避免误触 */
  #consult .items .item .msg{display:none !important;}
}

/* ===== 底部瘦身 2026-10-28 =====
   实测：整页 3025px，底部占 1015px（1/3），太长。
   footer-actions 589px、footer 426px。
   根因：el-image__placeholder 空占位 div 带固定高度 120px，
   加上 PC 的 padding/margin 残留。
   目标：底部压到 400px 以内。 */

@media (max-width: 820px){
  /* 彻底干掉空占位（PC 用来占位的 div，手机没意义） */
  .el-image__placeholder{display:none !important;}
  #footer-actions .normal > .container > .icon{display:none !important;}

  /* 需求条：一行文字 + 一行按钮，紧凑 */
  #footer-actions .normal{height:auto !important;padding:0 !important;}
  #footer-actions .normal .container{display:block;padding:14px 14px 16px !important;
    height:auto !important;text-align:center;}
  #footer-actions .text{margin:0 0 10px !important;font-size:14px;line-height:1.5;}
  #footer-actions .text > div:first-child{margin-bottom:2px;}
  #footer-actions .text .phone{justify-content:center;font-size:15px;margin-top:2px;font-weight:600;}
  #footer-actions .text .phone .el-image{display:none;}  /* 电话图标去掉，纯数字更清爽 */
  #footer-actions .btn{font-size:14px;padding:9px 26px;border-radius:20px;margin:4px 3px;}

  /* 页脚主体：二维码和联系方式并排，省一半高度 */
  #footer{padding:16px 14px 10px !important;}
  #footer .data{display:flex !important;align-items:flex-start;gap:14px;text-align:left;}
  #footer .data .qrcode{margin:0 !important;flex:none;}
  #footer .data .qrcode .el-image{width:88px;height:88px;}
  #footer .data .qrcode img{width:88px !important;height:88px !important;}
  #footer .data .qrcode span{font-size:11px;margin-top:4px;text-align:center;display:block;}
  #footer .data .msg{flex:1;min-width:0;margin:0 !important;}
  #footer .data .msg .title{font-size:15px;margin-bottom:6px;}
  #footer .data .msg table{font-size:12.5px;}
  #footer .data .msg table td{padding:2px 0;line-height:1.5;}
  #footer .data .msg table td:first-child{width:44px;color:#909399;}

  /* 版权两行压成小字 */
  #footer .icp{font-size:11px;line-height:1.55;padding:3px 0;color:#909399;}
}

/* 2026-10-28 补：真正的元凶找到了——
   pc-struct.css 里 #footer .data 写死 height:300px，
   #footer .icp 写死 width:1200px + height:48px。
   我前面的 flex 规则生效了但被这两个固定值压着，所以高度没降。
   必须显式改掉。 */
@media (max-width: 820px){
  #footer .data{height:auto !important;min-height:0 !important;
    display:flex !important;align-items:center !important;gap:14px;}
  #footer .icp{width:auto !important;height:auto !important;
    margin:0 !important;padding:5px 0 !important;display:block !important;
    text-align:center;font-weight:normal;}
  #footer .data .qrcode img{width:88px !important;height:88px !important;}
  #footer .data .msg{margin-left:0 !important;}
  #footer .data .msg .title{font-size:15px !important;margin-bottom:5px !important;}
  #footer .data .msg table{font-size:12.5px !important;line-height:1.5 !important;}
}

/* 2026-10-28 补二：
   ① 悬浮图标塌陷（iconH=0, imgW=0）——.icon 设 height:100% 但父级 flex 居中算不出高度。
      改成固定尺寸，不依赖父级。
   ② 折叠条到需求条之间有 56px 空白 —— .side 的 margin-bottom 18px + 容器 padding 叠加。 */
@media (max-width: 820px){
  /* 收掉多余空白 */
  .side{margin-bottom:0 !important;}
  .main{padding-bottom:8px !important;}
  #footer-actions .normal{margin-top:0 !important;padding-top:12px !important;}
}

/* ===== Logo 修复 2026-10-28 =====
   实测：header logo 宽 0、高 30（图已加载但被压扁）；页脚 logo 0x0。
   根因：① 我只设了 height:30px，没设 width，PC 的 .log{flex-shrink:1}
        在窄屏把宽度压成 0；② 页脚 logo 被我的 .el-image__placeholder
        和 .icon 隐藏规则误伤。
   修法：宽高都用 auto + 显式尺寸，父级禁止收缩。 */
@media (max-width: 820px){
  /* header logo：高度定死，宽度按比例，父级不收缩 */
  #header .log{flex-shrink:0 !important;flex-grow:0 !important;}
  #header .log img{height:30px !important;width:auto !important;
    max-width:none !important;display:block;}
  #header .fixed .container{gap:8px;}

  /* 页脚 logo：恢复显示，圆角小图 */
  #footer-actions .fixed .icon,
  #footer .icon{display:flex !important;}
  #footer .el-image__inner{width:auto !important;height:auto !important;
    max-width:100% !important;display:block;}
}

/* ===== 汉堡菜单 2026-10-28 =====
   参考同服务器 EHD 站（www.ehd.net.cn）的做法：原生 <details> 折叠，零 JS。
   桌面端 .nav-menu 隐藏、.items 显示；手机端反过来。
   好处：导航不再挤成一行横向滚动，点开是竖排大按钮，手指好点。 */

/* 桌面端：隐藏汉堡 */
#header .nav-menu{display:none;}

@media (max-width: 820px){
  /* 手机端：藏掉横排导航，显示汉堡 */
  #header .items{display:none !important;}
  #header .nav-menu{display:block;position:relative;margin-left:auto;margin-right:6px;}

  #header .nav-menu summary{
    list-style:none;cursor:pointer;width:38px;height:34px;
    display:flex;flex-direction:column;justify-content:center;align-items:center;
    gap:5px;border-radius:8px;background:#f5f7fa;
    -webkit-tap-highlight-color:transparent;
  }
  #header .nav-menu summary::-webkit-details-marker{display:none;}
  #header .nav-menu summary::marker{content:"";}
  #header .nav-menu summary span{
    display:block;width:18px;height:2px;background:#303133;border-radius:1px;
    transition:transform .2s,opacity .2s;
  }
  /* 展开时变 X */
  #header .nav-menu[open] summary span:nth-child(1){transform:translateY(7px) rotate(45deg);}
  #header .nav-menu[open] summary span:nth-child(2){opacity:0;}
  #header .nav-menu[open] summary span:nth-child(3){transform:translateY(-7px) rotate(-45deg);}

  /* 下拉面板 */
  #header .nav-menu .nav-links{
    position:absolute;right:0;top:44px;z-index:200;
    background:#fff;border:1px solid #ebeef5;border-radius:10px;
    box-shadow:0 6px 20px rgba(0,0,0,.12);
    min-width:170px;padding:6px 0;display:none;
  }
  #header .nav-menu[open] .nav-links{display:block;}
  #header .nav-menu .nav-links a{
    display:block;padding:11px 18px;font-size:15px;color:#303133;
    border-bottom:1px solid #f5f7fa;
  }
  #header .nav-menu .nav-links a:last-child{border-bottom:none;}
  #header .nav-menu .nav-links a.active{color:#409EFF;font-weight:600;}

  /* 电话在手机上放 logo 右侧，不挤 */
  #header .phone{margin-left:0;flex:none;}
}

/* 2026-10-28 补：汉堡菜单展开后被 .crumb（面包屑）盖住。
   实测 elementFromPoint 命中 DIV.crumb，说明 #header .fixed 的 z-index:98
   不够高，被后面内容的层叠上下文压住。
   提到 9999（低于悬浮咨询条 99999 的层级关系无所谓，两者不重叠）。 */
@media (max-width: 820px){
  #header .fixed{z-index:9999 !important;}
  #header .nav-menu .nav-links{z-index:10000 !important;}
}

/* 2026-10-28 补：汉堡菜单用 position:absolute 被父容器裁掉（实测强制 fixed 就正常）。
   #header .fixed 有 overflow 限制，absolute 定位的下拉面板超出即被裁。
   改成 fixed，相对视口定位，不受父容器影响。 */
@media (max-width: 820px){
  #header .nav-menu .nav-links{
    position:fixed !important;
    top:56px !important;left:10px !important;right:10px !important;
    min-width:0 !important;width:auto !important;
    max-height:calc(100vh - 80px);overflow-y:auto;
  }
  /* 父容器不要再限制溢出 */
  #header .fixed{overflow:visible !important;}
  #header .fixed .container{overflow:visible !important;}
}
