/* ============================================================
   HR校招助手 移动端适配覆盖层 v2 (mobile.css)
   生效条件: 屏幕宽度 <= 768px
   方案: 纯 CSS 覆盖,不修改编译产物 JS/HTML
   ============================================================ */

/* ==================== 0. 全局基座(全站) ==================== */
@media (max-width: 768px) {
  * {
    box-sizing: border-box;
  }
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }
  /* 全局字号: 20px → 14px */
  a,
  p,
  div[role="alert"] i,
  .el-date-picker__header,
  .el-form--inline,
  .el-form-item,
  .el-steps {
    font-size: 14px;
  }
  /* img 默认在 flex 容器会被拉伸,强制 */
  img {
    max-width: 100% !important;
    height: auto !important;
    flex-shrink: 0;
  }
  input,
  textarea,
  select {
    max-width: 100%;
  }
  .el-pagination {
    flex-wrap: wrap;
    justify-content: center;
    white-space: normal;
  }
}

/* ==================== 1. 登录 / 注册 / 忘记密码页 ==================== */
@media (max-width: 768px) {
  /* 背景图:保留品牌色但缩小范围(只占顶部一部分,卡片压在浅色上) */
  .login.flex.align-center.justify-center {
    background-size: 100% auto !important;
    background-position: top center !important;
    background-repeat: no-repeat !important;
    min-height: 100vh !important;
    align-items: flex-start !important;
    padding: 60px 0 20px !important;
  }
  /* 隐藏广告区(37%) + 占位(10%),只留卡片 */
  .login.flex.align-center.justify-center > div:not(.content) {
    display: none !important;
  }
  /* 卡片全宽自适应 + 圆角 */
  .login.flex.align-center.justify-center > .content {
    width: 92% !important;
    height: auto !important;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 22px 14px;
    box-sizing: border-box;
    border-radius: 16px !important;
  }
  .login.flex.align-center.justify-center .content > div {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  /* 标题字号缩小 */
  .login.flex.align-center.justify-center .content > div:first-child {
    font-size: 18px !important;
    margin-bottom: 16px !important;
    text-align: center;
  }
  /* 表单行:align-center → 允许内部换行,input 撑满 */
  .login.flex.align-center.justify-center .content .flex {
    flex-wrap: wrap !important;
    gap: 4px;
    padding: 8px 0 !important;
  }
  .login.flex.align-center.justify-center .content input {
    width: auto !important;
    flex: 1 1 100px !important;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 6px;
  }
  /* 关键修复:密码行/验证码行的 IMG 在 flex 被撑大,恢复 */
  .login.flex.align-center.justify-center .content img {
    flex: none !important;
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: 24px !important;
  }
  /* 密码显示/隐藏图标: 强制 20px(密码行 div 内的 img,不是 .xiaoshou) */
  .login.flex.align-center.justify-center .content div.flex > img {
    width: 20px !important;
    height: 20px !important;
  }
  /* 验证码图片 xiaoshou img: 强制 60x30 */
  .login.flex.align-center.justify-center .content img.xiaoshou {
    width: 60px !important;
    height: 30px !important;
    max-height: none !important;
  }
  /* "获取验证码"按钮: 放在 input 右边 */
  .login.flex.align-center.justify-center .content .xiaoshou:not(img) {
    flex: none !important;
    margin-left: auto !important;
    padding: 0 8px !important;
    color: #42b983;
    cursor: pointer;
  }
  /* 注册页 absolute 错误提示改静态 */
  .login.flex.align-center.justify-center .content span[style*="position:absolute"],
  .login.flex.align-center.justify-center .content span[style*="position: absolute"] {
    position: static !important;
    right: auto !important;
    left: auto !important;
    margin-top: 2px;
    display: block;
    width: 100% !important;
    color: #f56c6c;
    font-size: 12px;
  }
  /* 按钮/忘记密码等内联 width:240px → 拉满 */
  .login.flex.align-center.justify-center .content .backbg,
  .login.flex.align-center.justify-center .content .font.xiaoshou:not(img),
  .login.flex.align-center.justify-center .content .xiaoshou:not(img) {
    width: 100% !important;
    text-align: center;
    box-sizing: border-box;
  }
  /* 底部链接 "没有账号?" 等 */
  .login.flex.align-center.justify-center .content > div:last-child {
    text-align: center;
    margin-top: 12px;
  }
}

/* ==================== 2. 导航 IndexHead(全站共用) ==================== */
@media (max-width: 768px) {
  #navs {
    flex-wrap: wrap !important;
    width: 100%;
    padding: 0 10px !important;
  }
  /* logo 大幅缩小 */
  .img1 img {
    width: 45px !important;
    height: auto !important;
  }
  /* 6 项导航换行 */
  #nav {
    flex-wrap: wrap !important;
    width: 100% !important;
    justify-content: center !important;
    padding: 4px 0 !important;
  }
  #nav > div {
    min-width: 0 !important;
  }
  #nav a {
    margin: 2px 6px !important;
    min-width: 0 !important;
    font-size: 13px !important;
    padding: 4px 4px !important;
    white-space: nowrap;
  }
  #nav .login {
    margin-left: 4px !important;
    margin-top: 4px !important;
  }
  /* 顶部 banner 图: 限制最大高度 */
  body > div:first-child img,
  body > div img[width="100%"] {
    max-height: 80px;
    object-fit: cover;
  }
}

/* ==================== 3. 首页顶部广告 banner ==================== */
@media (max-width: 768px) {
  /* index.html 内嵌的顶部广告 banner(渐变蓝+薪老师直聘) */
  body > div[style*="linear-gradient(90deg"] {
    padding: 8px 12px !important;
    gap: 6px !important;
    font-size: 13px !important;
  }
  body > div[style*="linear-gradient(90deg"] > a {
    font-size: 13px !important;
    padding: 4px 10px !important;
  }
  body > div[style*="linear-gradient(90deg"] > span {
    font-size: 10px !important;
    padding: 1px 4px !important;
  }
  /* 第二个黑色横条信息 */
  body > div[style*="1CB278"],
  body > div[style*="#000"] {
    font-size: 12px !important;
    padding: 4px 8px !important;
  }
}

/* ==================== 4. 首页 hero / 标签 / 搜索 / 说明 ==================== */
@media (max-width: 768px) {
  /* hero "查学校 查双选会 查专业 就用HR校招助手" */
  .text.color.flex.justify-align-center {
    height: auto !important;
    font-size: 17px !important;
    padding: 14px 10px !important;
    line-height: 1.5;
    text-align: center;
    font-weight: 600;
  }
  .text.color.flex.justify-align-center br {
    display: inline;
    content: " ";
  }
  /* 3 个 tab: 按学院查询 / 按专业查询 / 查双选会 */
  .rou {
    margin-bottom: 12px !important;
    padding: 0 10px;
    justify-content: center;
  }
  .rou div {
    margin: 0 6px !important;
    font-size: 14px !important;
  }
  /* 免费注册说明 */
  .flex.justify-align-center.font {
    margin-right: 0 !important;
    font-size: 12px !important;
    padding: 0 10px;
    text-align: center;
  }
  /* 搜索区 */
  .search {
    margin-left: 0 !important;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
  }
  .search input {
    width: auto !important;
    flex: 1 !important;
    min-width: 0;
    margin: 0 4px;
    height: 36px !important;
    font-size: 13px;
  }
  .search > div {
    width: auto !important;
    flex: none;
  }
  .search .el-button {
    margin: 0 4px !important;
    padding: 8px 12px !important;
    font-size: 13px;
  }
}

/* ==================== 5. 首页筛选区 ==================== */
@media (max-width: 768px) {
  .jis > div {
    flex-wrap: wrap !important;
    padding: 0 10px !important;
    margin-bottom: 8px !important;
  }
  .jis > div > div:first-child {
    margin-right: 10px !important;
    font-size: 13px !important;
    min-width: 70px !important;
  }
  .jis .row_wrap {
    width: 100% !important;
    flex-wrap: wrap !important;
  }
  .jis .xiaoshou {
    margin-right: 10px !important;
    font-size: 13px !important;
  }
}

/* ==================== 6. 表格(保留横向滚动) ==================== */
@media (max-width: 768px) {
  .biao {
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
    padding: 0 10px;
  }
  .el-table__body-wrapper {
    -webkit-overflow-scrolling: touch;
  }
}

/* ==================== 7. 弹窗 ==================== */
@media (max-width: 768px) {
  .el-message-box,
  div[aria-label="TOP IDOL平台服务协议"] .el-message-box,
  div[aria-label="产品详情"] .el-message-box {
    width: auto !important;
    max-width: 94vw;
    overflow-x: auto;
  }
}

/* ==================== 8. 首页底部 SEO 内容和友情链接 ==================== */
@media (max-width: 768px) {
  /* #app 内嵌的 SEO 内容 */
  #app > div[style*="max-width:1000px"] {
    padding: 14px !important;
    font-size: 14px;
  }
  /* 底部友链区 */
  body > div[style*="#f1f3f5"] {
    font-size: 12px !important;
    padding: 12px 10px !important;
  }
}
/* ==================== 9. v3 修复(2026-08-16 CDP 实测审计后) ==================== */
/* 审计工具:无头 Chrome + CDP,iPhone 390x844 DPR2                              */

@media (max-width: 768px) {
  /* ---- 9.1 【最严重】首页整页横向偏移 443px ----
     根因:院校特性 .el-checkbox-group 是 flex-wrap:nowrap,9 个复选框硬撑到 807px,
     把 main.el-main 内容宽拉到 833px。父级 .row_wrap 虽已 wrap,但管不到它自己。 */
  .el-checkbox-group {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .el-checkbox-group .el-checkbox {
    margin-right: 14px !important;
    margin-bottom: 6px !important;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
  }
  .el-checkbox-group .el-checkbox__label {
    font-size: 13px !important;
    padding-left: 6px !important;
  }

  /* ---- 9.2 登录/注册按钮被压成 62x20,内部文字仅 6px 高 ---- */
  #nav .login.backbg {
    width: auto !important;
    min-width: 104px !important;
    height: auto !important;
    min-height: 40px !important;
    padding: 0 12px !important;
    margin-top: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px;
    line-height: normal !important;
    border-radius: 17px;
  }
  #nav .login.backbg .xiaoshou {
    width: auto !important;
    height: auto !important;
    min-height: 40px !important;
    line-height: 40px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    overflow: visible !important;
  }

  /* ---- 9.3 触控目标 <36px(首页实测 87 个)---- */
  #nav a,
  #nav > div > a {
    min-height: 40px !important;
    line-height: 40px !important;
    padding: 0 8px !important;
    display: inline-block;
  }
  #nav > div {
    display: inline-flex;
    align-items: center;
  }
  .jis .xiaoshou,
  .rou div {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
  }

  /* ---- 9.4 会员页权限对比表:3 列压缩进视口,不必横滑 ----
     用 el-table--border 精确区分(首页大表是 el-table--scrollable-x,不受影响) */
  .el-table--border,
  .el-table--border .el-table__header-wrapper,
  .el-table--border .el-table__body-wrapper {
    width: 100% !important;
    overflow-x: visible !important;
  }
  .el-table--border table.el-table__header,
  .el-table--border table.el-table__body {
    width: 100% !important;
    table-layout: fixed !important;
    min-width: 0 !important;
  }
  .el-table--border col {
    width: auto !important;
  }
  .el-table--border .cell {
    font-size: 12px !important;
    padding: 0 6px !important;
    white-space: normal !important;
    word-break: break-word;
    line-height: 1.4;
  }
  .el-table--border th,
  .el-table--border td {
    padding: 8px 0 !important;
  }
}

/* ==================== 10. 触控目标与细节打磨(2026-08-16) ==================== */
@media (max-width: 768px) {
  /* ---- 10.1 筛选 chip 34px → 38px(实测 75 个),兼顾拇指命中与页面长度 ---- */
  .xiaoshou {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
  }
  /* 注:.el-radio__original 是 opacity:0 的隐藏 input,真实点击区是外层 label,不需处理 */

  /* ---- 10.2 「查询」主操作按钮实测仅 28px 高 ---- */
  .search .el-button,
  .el-button--primary {
    min-height: 40px !important;
    padding: 0 18px !important;
    font-size: 14px !important;
  }

  /* ---- 10.3 顶部广告 CTA 实测仅 19px 高 ---- */
  body > div[style*="linear-gradient(90deg"] > a {
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  /* ---- 10.4 筛选行标签被 flex 居中导致缩进错乱,改为左对齐 ---- */
  .jis > div {
    justify-content: flex-start !important;
    align-items: flex-start !important;
  }
  .jis > div > div:first-child {
    text-align: left !important;
    flex: none !important;
  }
}

/* ==================== 11. 汉堡菜单 + 宽表滚动提示(配合 mobile-enhance.js) ==================== */

/* 桌面端彻底隐藏汉堡按钮 */
.m-burger { display: none; }

@media (max-width: 768px) {
  /* ---- 11.1 汉堡按钮 ---- */
  .m-burger {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .m-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #1CB278;
    border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
  }
  /* 展开时变 X */
  #navs.m-nav-open .m-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  #navs.m-nav-open .m-burger span:nth-child(2) { opacity: 0; }
  #navs.m-nav-open .m-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* ---- 11.2 导航默认收起,logo 与汉堡同一行 ---- */
  #navs {
    align-items: center !important;
    padding: 6px 12px !important;
  }
  #navs .img1 { flex: none; }

  #nav {
    display: none !important;
    order: 99;              /* 强制排到 logo/汉堡这一行之后 */
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 6px 0 10px !important;
    border-top: 1px solid #eee;
    margin-top: 6px;
  }
  #navs.m-nav-open #nav { display: flex !important; }

  /* 菜单项改为整行,点击区更大 */
  #nav > div,
  #nav > a {
    width: 100%;
    display: block !important;
  }
  #nav a {
    display: block !important;
    width: 100%;
    margin: 0 !important;
    padding: 0 8px !important;
    min-height: 46px !important;
    line-height: 46px !important;
    font-size: 15px !important;
    text-align: left;
    border-bottom: 1px solid #f5f5f5;
  }
  /* 登录/注册按钮居中显示在菜单底部 */
  #nav .login.backbg {
    margin: 10px auto 0 !important;
    width: 70% !important;
  }

  /* ---- 11.3 宽表格横向滚动提示 ---- */
  .m-scroll-hint {
    font-size: 12px;
    color: #8a8a8a;
    text-align: center;
    padding: 6px 0 4px;
    letter-spacing: .5px;
    transition: opacity .4s ease, height .4s ease;
  }
  .m-scroll-hint.m-hide {
    opacity: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
  }
  /* 首列吸附:横向滑动时院校名称保持可见,不丢失上下文 */
  .el-table--scrollable-x .el-table__body-wrapper td:first-child,
  .el-table--scrollable-x .el-table__header-wrapper th:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 2px 0 4px rgba(0,0,0,.06);
  }
  .el-table--scrollable-x .el-table__header-wrapper th:first-child { background: #f5f7fa; }
}

/* ==================== 12. 收尾打磨 ==================== */
@media (max-width: 768px) {
  /* 筛选行标签与 chip 基线对齐(chip 已 38px,标签需跟上) */
  .jis > div > div:first-child {
    min-height: 38px;
    display: inline-flex !important;
    align-items: center;
  }
}

/* ==================== 13. 院校详情页(首页组件的 type=1 模式)==================== */
/* 该视图无独立路由,由 localStorage.shuju 驱动。2026-08-17 实测修复 */

@media (max-width: 768px) {
  /* ---- 13.1 绿色锚点导航条 ----
     实测:容器 .font.backbg 高度写死 42px,内部内容 84px,溢出一倍,视觉上压住上方标签行。
     8 个锚点项 flex:1 平分 358px = 每个 45px,「就业办电话」5 字塞不下 → 截断+折行。 */
  .font.backbg {
    height: auto !important;
    min-height: 0 !important;
    padding: 8px 0 !important;
    overflow: visible !important;
  }
  .font.backbg .el-row--flex,
  .font.backbg .el-col-22 {
    height: auto !important;
  }
  .font.backbg .el-col-22 > .flex {
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 6px 4px;
    height: auto !important;
  }
  /* 锚点项:取消 flex:1 平分,改为按内容自适应 */
  .font.backbg .xiaoshou {
    flex: none !important;
    width: auto !important;
    height: auto !important;
    min-height: 34px !important;
    padding: 4px 9px !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    white-space: nowrap !important;
    border-radius: 15px;
    display: inline-flex !important;
    align-items: center;
  }
  /* 当前选中项 */
  .font.backbg .xiaoshou.bgactive {
    background: rgba(255, 255, 255, .28);
    font-weight: 600;
  }

  /* ---- 13.2 院校属性行 / 985·211 标签行:一律允许换行 ---- */
  .el-col-22 > .flex,
  .el-col-22 .flex.font {
    flex-wrap: wrap !important;
    height: auto !important;
  }
  /* 属性项之间留出间距,换行后不粘连 */
  .el-col-22 > .flex > .flex.align-center {
    margin-right: 14px;
    margin-bottom: 4px;
    flex: none !important;
  }

  /* ---- 13.3 院校名 + 关注/收藏 ---- */
  .el-col-22 > .flex > .borders.xiaoshou {
    flex: none !important;
    white-space: nowrap;
  }

  /* ---- 13.4 详情页底部双选会表格:压缩进视口 ---- */
  .el-table--border .cell {
    font-size: 12px !important;
  }
}

/* ==================== 14. 详情页头部 .bg1 固定高度导致内容被绿条盖住 ==================== */
@media (max-width: 768px) {
  /* 实测:.bg1 高度写死 180px,移动端内容实际需要 224px,溢出的 44px 被下方绿色锚点条覆盖。
     表现为 985/211 标签行"透"在绿条底下。 */
  .bg1 {
    height: auto !important;
    min-height: 0 !important;
    padding-bottom: 12px !important;
    overflow: visible !important;
  }
  .bg1 .el-row--flex,
  .bg1 .el-col-22,
  .bg1 .font {
    height: auto !important;
  }
  /* 头部区域内所有横向行一律允许换行(院校名/属性行/985 标签行/关注收藏) */
  .bg1 .flex {
    flex-wrap: wrap !important;
    height: auto !important;
  }
  /* 单个属性项不被压缩,换行后留间距 */
  .bg1 .flex > .flex.align-center {
    flex: none !important;
    margin-right: 14px;
    margin-bottom: 6px;
  }
  /* 关注/收藏按钮 */
  .bg1 .borders.xiaoshou {
    flex: none !important;
    white-space: nowrap;
    margin-right: 8px;
  }
}

/* ==================== 15. 详情页「收藏/关注」按钮组错位 ==================== */
@media (max-width: 768px) {
  /* 实测:该按钮组是 985 标签行内的 flex 项,带 position:relative; top:-20px
     (桌面端顶到右上角的微调)。移动端标签行换成 3 行后,它卡在中间并上移 20px,
     盖住「研究生院」那一项。改为独占一行。 */
  .bg1 .flex:has(> .borders.xiaoshou) {
    position: static !important;
    top: auto !important;
    flex: 0 0 100% !important;
    width: 100% !important;
    justify-content: flex-start !important;
    margin-top: 10px !important;
    gap: 10px;
  }
  /* 兜底:不支持 :has() 的旧内核,至少把上移量归零,避免覆盖 */
  .bg1 .flex .flex[style*="top"] {
    top: 0 !important;
  }
  .bg1 .borders.xiaoshou {
    min-height: 38px;
    padding: 0 14px !important;
    align-items: center;
  }
}

/* 收藏/关注 行:消除 24px 容器溢出(左侧有 40px 继承缩进) */
@media (max-width: 768px) {
  .bg1 .flex:has(> .borders.xiaoshou) {
    width: auto !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    box-sizing: border-box;
  }
}
