/* ================================================================
   移动端适配 v2（安全版）
   原则：只做「布局让位」，不干预组件的滚动/渲染机制
   ================================================================ */
@media (max-width:768px){

  /* ---------- 1. 侧边栏收窄为图标栏（让内容区变宽） ---------- */
  .el-aside{width:72px!important;min-width:72px!important;overflow:hidden!important}
  .el-menu{width:72px!important}
  .el-menu-item,.el-sub-menu__title{
    padding:0 4px!important;height:60px!important;line-height:1.15!important;
    display:flex!important;flex-direction:column!important;
    align-items:center!important;justify-content:center!important;
  }
  .el-menu-item .el-icon,.el-sub-menu__title .el-icon{
    font-size:20px!important;margin:0 0 3px 0!important;width:auto!important
  }
  .el-menu-item span,.el-sub-menu__title>span{
    font-size:10px!important;line-height:1.1!important;margin:0!important
  }

  /* ---------- 2. 内容区 ---------- */
  .el-main{padding:8px!important}
  .el-card__body{padding:10px!important}
  .el-form-item{margin-bottom:12px!important}
  .el-form-item__label{font-size:13px!important}
  .el-input__wrapper,.el-input__inner{font-size:14px!important}
  .el-button{padding:9px 14px!important;font-size:13px!important}
  .el-tabs__item{padding:0 12px!important;font-size:13px!important}
  .el-breadcrumb{font-size:12px!important}

  /* ---------- 3. 表格（仅字号，不碰滚动） ---------- */
  .el-table{font-size:12px!important}
  .el-table th,.el-table td{padding:8px 0!important}
  .vxe-table{font-size:12px!important}

  /* ---------- 4. 弹窗 / 抽屉 ---------- */
  .el-dialog{width:94%!important;margin-top:5vh!important;border-radius:10px!important}
  .el-dialog__header{padding:14px!important}
  .el-dialog__body{max-height:66vh;overflow-y:auto;padding:12px!important}
  .el-drawer{width:88%!important}
  .el-message-box{width:90%!important}
  .el-select-dropdown{max-width:92vw!important}
  .el-popper{max-width:92vw!important}

  /* ---------- 5. 分页 ---------- */
  .el-pagination{flex-wrap:wrap!important;justify-content:center!important}
  .el-pagination__sizes,.el-pagination__jump{display:none!important}

  /* ---------- 6. 登录页（原登录框写死800px，手机放不下） ---------- */
  .login-container{background-size:cover!important}
  .login-container .login-position{padding:16px!important;box-sizing:border-box!important}
  .login-container .login-position .login-box{
    width:100%!important;max-width:430px!important;height:auto!important;
    flex-direction:column!important;border-radius:14px!important;
    box-shadow:0 8px 30px rgba(0,0,0,.12)!important
  }
  .login-container .login-position .login-box .login-bg{display:none!important}
  .login-container .login-position .login-box .login-content{
    padding:26px 20px!important;box-sizing:border-box!important
  }
  .login-container .login-position .login-box .login-content .logo-container .logo{
    width:52px!important;height:52px!important
  }
  .login-container .login-position .login-box .login-content .logo-container .title{font-size:17px!important}
  .login-container .login-position .login-box .login-content .form-container .item{margin-top:16px!important}
  .login-container .login-position .login-box .login-content .form-container .submit-button{margin-top:22px!important}
  .login-container .login-position .login-box .login-content .form-container .submit-button .submit{
    height:46px!important;font-size:16px!important;border-radius:8px!important
  }
  .login-box .el-input__wrapper,.login-box .el-input__inner{height:44px!important;font-size:15px!important}
  .login-container .xhadmin-copyright{height:30px!important;font-size:11px!important}

  /* ---------- 7. 触摸优化 ---------- */
  .el-button,.el-menu-item,.el-table__row,.vxe-body--row{
    -webkit-tap-highlight-color:rgba(45,140,240,.12)
  }
}

/* ============ 8. SaaS「全部项目」卡片页适配（关键：重置 grid-column） ============ */
@media (max-width:768px){
  .project-container{padding:10px!important;box-sizing:border-box!important}

  /* 网格：24列制 → 单列 */
  .xh-project .project-list-grid{
    grid-template-columns:1fr!important;gap:12px!important;display:grid!important
  }
  /* 核心修复：原卡片 grid-column:span 6（一行4个），必须重置 */
  .xh-project .project-list-grid .item,
  .xh-project .project-list-grid>.item{
    grid-column:auto/auto!important;width:100%!important;max-width:100%!important;
    margin:0!important;padding:12px!important;box-sizing:border-box!important;
    border-radius:12px!important
  }
  /* 列表模式（span 24）同样重置 */
  .xh-project .project-list-list .item,
  .xh-project .project-list-list>.item{
    grid-column:auto/auto!important;width:100%!important;padding:12px!important;
    box-sizing:border-box!important;flex-direction:column!important
  }
  .xh-project{padding:10px!important}

  /* 卡片内部 */
  .xh-project .item .logo,.xh-project .item .icon{
    width:44px!important;height:44px!important;flex-shrink:0!important
  }
  .xh-project .item .project-info{flex:1!important;min-width:0!important}
  .xh-project .item .title,.xh-project .item .project-info .title{
    font-size:14px!important;line-height:1.35!important;
    white-space:normal!important;word-break:break-word!important
  }
  .xh-project .item .tags,.xh-project .item .auth,
  .xh-project .item .created,.xh-project .item .site-info{
    font-size:11px!important;line-height:1.6!important
  }

  /* 按钮：均分加宽 */
  .xh-project .item .btns{
    display:flex!important;flex-wrap:wrap!important;gap:8px!important;
    margin-top:10px!important;width:100%!important
  }
  .xh-project .item .btns .el-button,
  .xh-project .item .btns button{
    flex:1 1 66px!important;min-width:66px!important;margin:0!important;
    height:38px!important;font-size:13px!important;border-radius:8px!important
  }

  /* 顶部标签栏横滑 */
  .project-container .tabs,.project-container .category{
    display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;
    white-space:nowrap!important;-webkit-overflow-scrolling:touch;
    gap:6px!important;padding-bottom:6px!important
  }
  .project-container .tabs .item,.project-container .category .item{
    flex:0 0 auto!important;font-size:13px!important
  }
  .project-container .develop-btn{height:38px!important;font-size:13px!important;flex:0 0 auto!important}

  .xh-paginate{margin-top:12px!important;display:flex!important;justify-content:center!important}
  .project-empty{padding:30px 12px!important;font-size:13px!important}
}

/* ============ 9. 项目卡片按钮：进入管理平台（全宽大按钮） ============ */
.xh-project .item .btns{
  display:flex!important;flex-wrap:wrap!important;align-items:center!important;
  gap:8px!important;margin-top:12px!important;width:100%!important
}
/* 进入管理平台：整行全宽、大号 */
.xh-project .item .btns .el-dropdown{
  order:-1!important;flex:1 1 100%!important;width:100%!important
}
.xh-project .item .btns .el-dropdown .el-button{
  height:46px!important;font-size:16px!important;font-weight:600!important;
  border-radius:10px!important;padding:0 18px!important;letter-spacing:1px!important
}
.xh-project .item .btns .el-dropdown .el-dropdown__caret-button{
  padding:0 14px!important;border-radius:0 10px 10px 0!important
}
.xh-project .item .btns .el-dropdown .el-dropdown__caret-button .el-icon{font-size:16px!important}
/* 编辑/删除按钮已折叠隐藏，双保险 */
.xh-project .item .btns>.el-button,
.xh-project .item .btns .el-popconfirm{display:none!important}

@media (max-width:768px){
  .xh-project .item .btns .el-dropdown .el-button{height:50px!important;font-size:17px!important}
  .xh-project .item .btns .el-dropdown .el-dropdown__caret-button{padding:0 16px!important}
}

/* ============ 10. 右下角悬浮按钮组（主页/项目/返回/刷新） ============ */
:root{
  --xh-fab:58px;            /* 按钮直径 */
  --xh-fab-gap:14px;        /* 间距 */
  --xh-fab-right:16px;      /* 距右边 */
  --xh-fab-bottom:33%;      /* 起始高度：距底部 1/3 */
  --xh-fab-step:72px;       /* 每个按钮的垂直步进 = 直径+间距 */
}
.xh-fab{
  position:fixed;right:var(--xh-fab-right);
  width:var(--xh-fab);height:var(--xh-fab);border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  color:#fff;z-index:99999;cursor:pointer;user-select:none;
  transition:transform .25s ease,background .2s ease,box-shadow .2s ease;
  -webkit-tap-highlight-color:transparent;touch-action:manipulation;
}
.xh-fab svg{width:26px;height:26px;display:block}

/* --- 自下而上堆叠 --- */
.xh-fab-refresh{                                   /* 第1个：刷新 */
  bottom:var(--xh-fab-bottom);
  background:linear-gradient(135deg,#3d9bff,#1a6fd4);
  box-shadow:0 6px 18px rgba(45,140,240,.45);
}
.xh-fab-refresh:active{background:linear-gradient(135deg,#1a6fd4,#1257a8);box-shadow:0 3px 10px rgba(45,140,240,.6)}

.xh-fab-back{                                      /* 第2个：返回 */
  bottom:calc(var(--xh-fab-bottom) + var(--xh-fab-step));
  background:linear-gradient(135deg,#8b95a5,#5f6b7c);
  box-shadow:0 6px 18px rgba(95,107,124,.42);
}
.xh-fab-back:active{background:linear-gradient(135deg,#5f6b7c,#454f5e);box-shadow:0 3px 10px rgba(95,107,124,.55)}

.xh-fab-store{                                     /* 第3个：项目管理主页 */
  bottom:calc(var(--xh-fab-bottom) + var(--xh-fab-step) * 2);
  background:linear-gradient(135deg,#2fd4d4,#12a3a3);
  box-shadow:0 6px 18px rgba(20,201,201,.42);
}
.xh-fab-store:active{background:linear-gradient(135deg,#12a3a3,#0d8585);box-shadow:0 3px 10px rgba(20,201,201,.55)}

.xh-fab-home{                                      /* 第4个：登录后主页 */
  bottom:calc(var(--xh-fab-bottom) + var(--xh-fab-step) * 3);
  background:linear-gradient(135deg,#9d5cf5,#722ed1);
  box-shadow:0 6px 18px rgba(114,46,209,.42);
}
.xh-fab-home:active{background:linear-gradient(135deg,#722ed1,#5a1fa8);box-shadow:0 3px 10px rgba(114,46,209,.55)}

@media (max-width:768px){
  :root{--xh-fab:62px;--xh-fab-gap:16px;--xh-fab-right:14px;--xh-fab-step:78px}
  .xh-fab svg{width:28px;height:28px}
}

/* ============ 11. 二级侧边栏（站点管理/回收站）移动端适配 ============ */
@media (max-width:900px){
  /* 折叠开关：加大点击区域 */
  .side-action{
    width:40px!important;height:40px!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    cursor:pointer!important
  }
  .side-action svg{width:22px!important;height:22px!important}
  /* 二级菜单面板：窄屏自适应，避免过宽挤压内容 */
  .xhadmin-menus-pro{
    max-width:46vw!important;box-sizing:border-box!important;
    overflow-y:auto!important;-webkit-overflow-scrolling:touch
  }
  .xhadmin-menus-pro .text{font-size:13px!important;white-space:normal!important;word-break:break-word!important}
  /* 折叠后内容区占满 */
  .xhadmin-menus-pro[style*="width: 0"],.xhadmin-menus-pro[style*="width:0"]{display:none!important}
}
