/* ============================================================
   线索雷达 · 移动端适配层（mobile.css）
   仅在窄屏（≤768px）生效，加载于 styles.css 之后，作为覆盖层。
   桌面端（>768px）既有样式完全不受影响，零回归风险。
   ============================================================ */
@media (max-width: 768px) {

  /* ---------- 通用：触摸友好 ---------- */
  body { font-size: 15px; -webkit-text-size-adjust: 100%; }
  .page { padding: 16px 14px 56px; }
  .page-head { margin-bottom: 16px; }
  .page-head h2 { font-size: 22px; line-height: 1.25; }
  .kicker { font-size: 11px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }

  /* ---------- 顶栏 ---------- */
  .topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 10px;
    gap: 6px;
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(17, 19, 26, .92);
    backdrop-filter: saturate(1.4) blur(8px);
    -webkit-backdrop-filter: saturate(1.4) blur(8px);
  }
  .brand { order: 1; }
  .brand-txt i { display: none; }            /* 副标题占位太宽，手机上藏掉 */
  .topbar-right { order: 2; margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .tag-demo { display: none; }               /* 省一行空间 */
  .topbar-right .btn { font-size: 13px; padding: 7px 11px; }
  .nav {
    order: 3;                                /* 第二行整行 */
    width: 100%;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 2px;
    padding: 4px 0 2px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 999px;
  }
  .nav a.on { background: rgba(255, 255, 255, .12); }

  /* 用户菜单：窄屏改成底部抽屉，不会被顶栏裁切 */
  .user-pop {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    width: 100%;
    border-radius: 16px 16px 0 0;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
    z-index: 200;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .4);
  }

  /* ---------- 登录页 ---------- */
  .auth-wrap { flex-direction: column; min-height: auto; padding: 28px 16px; }
  .auth-side { display: none; }              /* 手机上不留长篇叙述，直接进 */
  .auth-card { width: 100%; max-width: 460px; margin: 0 auto; }
  .auth-tabs { display: flex; gap: 8px; }
  .auth-tabs button { flex: 1; }
  .auth-pin {
    height: 58px;
    font-size: 28px;
    letter-spacing: 10px;
    text-align: center;
    text-indent: 10px;                       /* 抵消 letter-spacing 视觉偏移 */
  }
  .auth-submit { width: 100%; }
  .auth-field input,
  .auth-pwd input { font-size: 16px; }       /* 16px 避免 iOS 聚焦自动放大 */

  /* ---------- 首页 hero ---------- */
  .hero-wrap { display: flex; flex-direction: column; gap: 24px; }
  .hero-left, .hero-right { width: 100%; }
  .hero-title { font-size: 30px; }
  .hero-sub { font-size: 15px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
  .hero-stats { gap: 16px; }
  .steps { grid-template-columns: 1fr !important; }
  .why { grid-template-columns: 1fr !important; }
  .industry-row { flex-wrap: wrap; gap: 8px; }
  .cta-inner h2 { font-size: 24px; }
  .cta-inner .btn { width: 100%; }

  /* ---------- AI 交代任务 ---------- */
  .task-card { padding: 16px; }
  .task-row { display: flex; flex-direction: column; gap: 14px; }
  .task-row .field { width: 100%; }
  .src-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .task-actions { flex-direction: column; align-items: stretch; }
  .task-actions .btn { width: 100%; }
  .task-actions .hint { margin: 0; }

  /* ---------- 工作台 ---------- */
  .kpis { grid-template-columns: repeat(2, 1fr) !important; }
  .chart-grid { grid-template-columns: 1fr !important; }
  .page-head.row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .head-actions { width: 100%; display: flex; gap: 8px; }
  .head-actions .btn { flex: 1; }

  /* ---------- 意向客户 ---------- */
  .filters { flex-wrap: wrap; gap: 8px; }
  .filters .search-wrap { width: 100%; }
  .filters select { flex: 1 1 auto; min-width: 120px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .lead-table { min-width: 720px; font-size: 13px; }

  /* ---------- AI 获客工坊：三栏 → 主区全宽 + 侧栏抽屉 ---------- */
  .studio { display: block; }
  .st-main { width: 100%; }
  .st-side {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 84%; max-width: 320px;
    z-index: 120;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 2px 0 22px rgba(0, 0, 0, .35);
  }
  .st-side.on { transform: translateX(0); }
  .st-brief {
    position: fixed;
    top: 0; bottom: 0; right: 0;
    width: 88%; max-width: 360px;
    z-index: 130;
    transform: translateX(100%);
    transition: transform .25s ease;
    box-shadow: -2px 0 22px rgba(0, 0, 0, .35);
  }
  .st-brief.on { transform: translateX(0); }
  .st-side-mask {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 110;
  }
  .st-top { padding: 10px 12px; }
  .st-compose { padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .st-input-bar { flex-wrap: wrap; gap: 6px; }
  .st-send { width: 44px; height: 44px; }

  /* ---------- 弹窗 / 抽屉 / 详情 ---------- */
  .modal { padding: 0; }
  .modal-card {
    width: auto;
    max-width: none;
    margin: 8px;
    max-height: calc(100vh - 16px);
  }
  .modal-card.wide { width: auto; }
  .member-tools { display: flex; flex-direction: column; gap: 8px; }
  .member-tools input,
  .member-tools select,
  .member-tools .btn { width: 100%; }
  .drawer {
    left: 0; right: 0;
    width: auto;
    max-width: none;
  }

  /* ---------- 页脚 ---------- */
  .foot { padding: 24px 14px; }
  .foot-in { flex-direction: column; gap: 8px; text-align: center; }
}
