/* ==========================================================
   秋招看板 · 手机适配（全站共享）
   在各页面自己的 <style> 之后引入，靠后加载保证能覆盖。
   只在窄屏 / 触摸设备生效，桌面端完全不受影响。
   ========================================================== */

/* ---------- 1. 触摸设备：只在 hover 出现的按钮改为常驻 ---------- */
/* 手机没有 hover，原来靠 :hover 才显示的「编辑/删除」按钮根本点不到 */
@media (hover: none) {
  .pos-actions,
  .pos-act,
  .rm-item .ri-dismiss { opacity: 1 !important; }
  /* 移动端点完会残留 hover 高亮，这里去掉位移效果 */
  .cc:hover, .pos:hover, .hc:hover, .tc:hover, .stc:hover { transform: none; }
}

/* ---------- 2. 窄屏通用 ---------- */
@media (max-width: 820px) {
  html { font-size: 14px; overflow-x: clip; }
  :root { --nav-h: 52px; }

  /* ===== 顶部导航：单行 + 横向滚动 ===== */
  .nav {
    height: 52px;
    padding: 0 10px;
    gap: 6px;
  }
  .nav-logo { font-size: 1rem; gap: 4px; }
  .nav-logo span { width: 22px; font-size: 1.1rem; }

  .nav-links {
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    /* 关键：flex 子项默认 min-width:auto，会被内容撑开 → 整页横向溢出 */
    min-width: 0;
    flex: 1 1 auto;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a {
    padding: 6px 9px;
    font-size: .76rem;
    flex-shrink: 0;
  }
  .nav-links a.active::after { bottom: 0; }

  .nav-right { gap: 6px; }
  .nav-search {
    width: 108px;
    font-size: .7rem;
    padding: 5px 8px 5px 26px;
    background-position: 7px center;
  }
  .nav-user { padding: 3px 8px; font-size: .74rem; }
  .nav-user #navUserName { display: none; }
  .nav-logout { padding: 4px 3px; font-size: .7rem; }

  /* ===== 页面容器 ===== */
  .app { padding-left: 14px; padding-right: 14px; }
  .title-section h1 { font-size: 1.4rem; }

  /* ===== 网格一律单列 ===== */
  .grid { grid-template-columns: 1fr !important; gap: 12px; }
  .tests-grid, .ts-cards { grid-template-columns: 1fr !important; }
  .stats { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }

  /* ===== 弹窗：底部弹出、可滚动、占满宽度 ===== */
  .mo, .tl-overlay {
    padding-top: 0 !important;
    align-items: flex-end !important;
  }
  .md, .tl-box {
    width: 100% !important;
    max-width: none !important;
    max-height: 90vh;
    border-radius: 18px 18px 0 0 !important;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom)) !important;
  }

  /* ===== 岗位阶段流程条：横向滚动，别把卡片撑破 ===== */
  .pos-pipe {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .pos-pipe::-webkit-scrollbar { display: none; }
  .pp-stage { min-width: 24px; }
  .pp-date { font-size: .56rem; }

  /* ===== 公司卡 / 岗位行 ===== */
  .cc-top { flex-wrap: wrap; row-gap: 6px; padding: 14px 14px 0; }
  .positions { padding: 10px 14px 12px; gap: 8px; }
  .pos { padding: 10px 12px; }
  .pos-title { flex-wrap: wrap; row-gap: 4px; }
  .pos-status { margin-left: 0; }
  /* 操作按钮常驻并挪到行内，避免绝对定位挡住内容 */
  .pos-actions {
    opacity: 1;
    position: static;
    justify-content: flex-end;
    margin-top: 8px;
    background: transparent;
    box-shadow: none;
    padding: 0;
  }
  /* 触控目标放大到 30px（原 24px 太小，手指点不准） */
  .pos-act { width: 30px; height: 30px; font-size: .72rem; }

  /* ===== 统计卡 ===== */
  .hero { gap: 10px; margin-bottom: 18px; }
  .hc { min-width: calc(50% - 5px); padding: 14px 16px; }
  .hc-v { font-size: 1.5rem; }

  /* ===== 过滤条 / 分类条：横向滚动 ===== */
  .filters, .ts-filter {
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .filters::-webkit-scrollbar,
  .ts-filter::-webkit-scrollbar { display: none; }
  .fp, .tsf { flex-shrink: 0; }

  /* ===== 排序条：允许换行，并让"共 N 家公司"独占一行 ===== */
  /* 原来 .result-c 被挤成 11px 宽，文字竖排撑出 142px 的空白 */
  .sort-bar {
    gap: 6px;
    flex-wrap: wrap;
    overflow: visible;
  }
  .sort-bar select { flex-shrink: 0; }
  .sort-bar input#searchInput {
    width: auto !important;
    flex: 1 1 110px;
    min-width: 96px;
  }
  .result-c {
    flex-basis: 100%;
    margin-left: 0;
    text-align: right;
    white-space: nowrap;
    font-size: .7rem;
  }

  /* ===== 表格 / 代码块别撑破 ===== */
  pre, code, table { max-width: 100%; overflow-x: auto; }
  img { max-width: 100%; height: auto; }

  /* ===== 登录弹窗（common.js 运行时注入，样式在 <link> 之后 → 必须 !important） ===== */
  .qz-auth-overlay { padding: 16px !important; }
  .qz-auth-box {
    width: 100% !important;
    max-width: 340px !important;
    padding: 22px 18px !important;
  }
  /* iOS Safari 输入框字号 < 16px 会自动放大页面 */
  .qz-auth-box input { font-size: 16px !important; }

  /* ===== 知识库 / 日历侧栏：小屏时铺满 ===== */
  .sidebar { width: 100% !important; max-width: none !important; }
}

/* ---------- 3. 小屏手机 ---------- */
@media (max-width: 560px) {
  .nav-search { display: none; }
  .hc { min-width: calc(50% - 5px); }
  .md, .tl-box { padding-left: 14px !important; padding-right: 14px !important; }
  .cc-latest-date { display: none; } /* 日期次要信息，腾出空间给岗位名 */
}

/* ---------- 4. 横屏矮屏 ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  .mo, .tl-overlay { align-items: flex-start !important; padding-top: 8px !important; }
  .md, .tl-box { max-height: 94vh; border-radius: 14px !important; width: 94% !important; }
}

/* ---------- 5. 底部安全区（iPhone 刘海屏） ---------- */
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 820px) {
    .app { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
    .bottom-bar { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  }
}
