/* mobile.css —— 移动端适配叠加层(2026-07-14,锚 docs/迭代/2026-07-14-移动端适配)。
   规则:仅 ≤720px 生效;唯一无条件规则=隐藏移动专属 DOM。不修改任何既有文件,后载覆盖。
   注意:本文件注释内禁止出现星杠闭合字符序列(仓库已踩坑,会吞掉其后全部规则) */

/* 移动专属 DOM 桌面隐藏(无条件,防裸露) */
.m-topbar, .m-scrim, .m-admin-note { display: none; }

@media (max-width: 720px) {

  /* ============ 视口:dvh 全链(iOS 地址栏/键盘动态视口) ============ */
  #app, .view, .ws, .workspace { height: 100dvh; }
  .admin { height: 100dvh; }
  .login-shell { height: 100dvh; overflow-y: auto; }

  /* ============ 移动顶栏 ============ */
  .m-topbar {
    display: flex; align-items: center; gap: 10px;
    position: fixed; top: 0; left: 0; right: 0; z-index: 40;
    height: calc(52px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 12px 0;
    background: #fff; border-bottom: 1px solid var(--line);
  }
  .m-burger {
    position: relative; width: 40px; height: 40px; flex: none;
    border: 0; border-radius: 10px; background: none; color: var(--ink);
    display: grid; place-items: center; cursor: pointer;
  }
  .m-burger:active { background: var(--soft); }
  .m-burger-dot {
    position: absolute; top: 7px; right: 7px; width: 7px; height: 7px;
    border-radius: 50%; background: #E5484D;
  }
  .m-logo { display: inline-flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 800; color: var(--ink); }
  .m-logo img { width: 22px; height: 22px; border-radius: 6px; display: block; }
  .m-credits { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--green-d); }
  .m-credits .spark { color: var(--green); margin-right: 2px; }
  .m-login {
    margin-left: auto; height: 32px; padding: 0 12px; border: 0; border-radius: 999px;
    background: var(--green); color: #fff; font-size: 12.5px; font-weight: 700; cursor: pointer;
  }
  .workspace { padding-top: calc(52px + env(safe-area-inset-top, 0px)); }

  /* ============ 左栏 → 抽屉 ============ */
  .sidebar {
    display: flex;                         /* 覆盖 layout.css 720 档的 display:none */
    position: fixed; top: 0; left: 0; bottom: 0; height: auto;
    width: min(84vw, 360px); z-index: 45;
    padding-top: env(safe-area-inset-top, 0px);
    transform: translateX(-105%); transition: transform .22s ease;
    box-shadow: 0 0 44px rgba(20, 23, 27, .22);
  }
  .sidebar.is-m-open { transform: none; }
  .m-scrim {
    display: block; position: fixed; inset: 0; z-index: 44;
    background: rgba(20, 23, 27, .42);
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .m-scrim.is-on { opacity: 1; pointer-events: auto; }

  /* ============ composer / 键盘 / safe-area ============ */
  .composer { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .feed { padding-bottom: calc(190px + env(safe-area-inset-bottom, 0px)); }
  .suggest { max-height: min(300px, 35dvh); }
  .toast-host { bottom: calc(105px + env(safe-area-inset-bottom, 0px)); }

  /* ============ 浮窗与报告正文 ============ */
  /* 移动端浮窗=全屏页:z 提到顶栏(40)与抽屉(45)之上,内容避开刘海 */
  .drawer { z-index: 46; padding-top: env(safe-area-inset-top, 0px); }
  .drawer-body { padding: 14px 14px 32px; }
  .report-body table { display: block; overflow-x: auto; }
  .lightbox .lb-dots { bottom: calc(26px + env(safe-area-inset-bottom, 0px)); }
  .lightbox-close { top: calc(18px + env(safe-area-inset-top, 0px)); }

  /* ============ v3 组件断点 ============ */
  .sc-draws { grid-template-columns: repeat(2, 1fr); }
  .sc-cats { grid-template-columns: 1fr; }
  .pz-draws { grid-template-columns: repeat(2, 1fr); }

  /* 触控热区:小圆点扩到实触 ≥28px(视觉不变) */
  .hj-dot, .lightbox .lb-dot { position: relative; }
  .hj-dot::after, .lightbox .lb-dot::after { content: ''; position: absolute; inset: -11px; }
  .hj-zoom { width: 32px; height: 32px; }

  /* ============ iOS 聚焦缩放防护(输入字号 ≥16px) ============ */
  .input { font-size: 16px; }
  .search-box input { font-size: 16px; }

  /* ============ admin 降级提示 ============ */
  .m-admin-note {
    display: block; padding: 8px 14px; font-size: 12.5px;
    color: #8A5A16; background: #FBF2E4; border-bottom: 1px solid #F2E3C8;
  }
}
