/* ================================================================
   移动端适配层（2026-11-10）
   - 只在 ≤900px 生效，桌面端视觉完全不变
   - 侧栏改为抽屉（白色浅色面板），顶栏加菜单按钮
   - 表格保留横向滚动，卡片 / 表单 / 弹窗按手机宽度重排
   - 依赖 mobile-nav.js 给 body 打的 .mnav 标记
   本文件在 theme-dark.css 之后加载。
   ================================================================ */

/* 标讯日期区间：桌面端保持一行排列 */
.ann-dates { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ann-dates > .xc-wrap { flex: 0 0 118px; width: 118px; }
/* 抽屉关闭按钮只在手机抽屉里出现，桌面端必须隐藏 */
body > .nav-close, .sidebar .nav-close, #appView .nav-close { display: none; }
/* 工具栏日期控件桌面端保持固定宽度 */
.toolbar > .xc-wrap { flex: 0 0 132px; }
/* 手机卡片列表：桌面端一律不显示，桌面继续用表格 */
.m-cards { display: none; }

@media (max-width: 900px) {

  /* ---------------- 应用外壳 ---------------- */
  #appView { height: 100vh; height: 100dvh; }
  #appView .main { width: 100%; min-width: 0; }

  .content {
    padding: 14px 12px calc(24px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  /* ---------------- 顶栏 ---------------- */
  .topbar {
    height: 56px;
    padding: 0 10px 0 6px;
    gap: 6px;
    background: #ffffff;
    backdrop-filter: none;
  }
  .topbar .title {
    font-size: 16px;
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
  }
  #offlineBtn { display: none; }
  #userBox { display: none; }
  .topbar .btn.sm { height: 34px; font-size: 13px; padding: 0 12px; }
  .topbar .btn.sm.icon-btn { width: 34px; padding: 0; }

  /* 汉堡菜单按钮 */
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #334155;
    cursor: pointer;
    transition: background .2s var(--ease), border-color .2s var(--ease);
  }
  .nav-toggle:hover { background: #f4f6fb; }
  .nav-toggle:active { background: #eef2f9; }
  .nav-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
  .nav-toggle svg { width: 22px; height: 22px; display: block; }

  /* ---------------- 抽屉式侧栏 ---------------- */
  body.mnav .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 276px;
    max-width: 86vw;
    flex: none;
    z-index: 120;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    color: #1f2937;
    border-right: 1px solid #e6eaf2;
    border-radius: 0 16px 16px 0;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .18);
    padding-top: env(safe-area-inset-top);
    transform: translateX(-102%);
    transition: transform .32s var(--ease);
    overflow: hidden;
  }
  body.mnav.nav-open .sidebar { transform: none; }
  body.mnav .sidebar .brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 18px 52px 16px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    border-bottom: 1px solid #eef1f6;
  }
  body.mnav .brand-text { display: flex; color: #0f172a; }
  body.mnav .brand-text small { color: #8a93a3; }
  body.mnav .nav-close {
    display: inline-flex;
    position: absolute;
    top: calc(14px + env(safe-area-inset-top));
    right: 12px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #ecf0f6;
    border-radius: 10px;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    z-index: 2;
  }
  body.mnav .nav-close:active { background: #f4f6fb; }
  body.mnav .nav-close svg { width: 18px; height: 18px; }
  body.mnav .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    font-size: 13px;
  }
  body.mnav .sidebar nav { padding: 10px 10px 12px; gap: 2px; }
  body.mnav .nav-item {
    justify-content: flex-start;
    padding: 12px 12px;
    gap: 10px;
    font-size: 14px;
    line-height: 20px;
    color: #3f4759;
    border-radius: 10px;
    transform: none;
  }
  body.mnav .nav-item:hover { background: #f6f8fc; color: #1d4ed8; transform: none; }
  body.mnav .nav-item.active {
    background: #eff5ff;
    color: #1d4ed8;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #2563eb;
  }
  body.mnav .nav-icon { color: #94a3b8; }
  body.mnav .nav-item.active .nav-icon { color: #2563eb; }
  body.mnav .nav-item .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 11px;
  }
  body.mnav .sidebar .foot {
    display: block;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid #eef1f6;
    font-size: 12px;
    line-height: 18px;
    color: #64748b;
  }
  body.mnav .sidebar .foot .foot-role { color: #94a3b8; font-size: 11px; }

  /* 遮罩 */
  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s var(--ease);
  }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  body.nav-open .topbar { border-bottom-color: transparent; }

  /* 暗色主题下的抽屉 */
  html[data-theme="dark"] body.mnav .sidebar {
    background: #1f1f1f;
    border-right-color: #313131;
    color: #e9ebef;
  }
  html[data-theme="dark"] body.mnav .sidebar .brand { color: #f4f5f7; border-bottom-color: #313131; }
  html[data-theme="dark"] body.mnav .brand-text { color: #f4f5f7; }
  html[data-theme="dark"] body.mnav .brand-text small { color: #8f97a3; }
  html[data-theme="dark"] body.mnav .nav-close { background: #272727; border-color: #313131; color: #c6cbd3; }
  html[data-theme="dark"] body.mnav .nav-item { color: #c6cbd3; }
  html[data-theme="dark"] body.mnav .nav-item:hover { background: #272727; color: #fff; }
  html[data-theme="dark"] body.mnav .nav-item.active { background: rgba(37, 99, 235, .18); color: #fff; }
  html[data-theme="dark"] body.mnav .sidebar .foot { color: #9aa1ac; border-top-color: #313131; }

  /* ---------------- 卡片与标题 ---------------- */
  .card {
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 12px;
  }
  .card h3 { font-size: 15px; line-height: 22px; margin-bottom: 10px; }
  .card-head { gap: 8px; }
  .grid2, .grid3 { gap: 12px; }

  /* ---------------- 筛选栏：搜索占整行，其余两列 ---------------- */
  .toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
  }
  .toolbar > input:not([type="checkbox"]):not([type="radio"]):not([type="date"]),
  .toolbar > textarea {
    flex: 1 1 100%;
    width: 100% !important;
    min-width: 0 !important;
    height: 42px;
  }
  .toolbar > select {
    flex: 1 1 calc(50% - 4px);
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(50% - 4px);
    height: 42px;
  }
  .toolbar > input[type="date"] {
    flex: 1 1 40%;
    width: auto !important;
    min-width: 0 !important;
    height: 42px;
  }
  /* custom-controls.js 会把日期输入包一层 .xc-wrap */
  .toolbar > .xc-wrap { flex: 1 1 40%; min-width: 0; }
  .toolbar > .xc-wrap input { width: 100% !important; min-width: 0; height: 42px; }
  .toolbar > .ann-dates { flex: 1 1 100%; }
  .toolbar > .ann-dates > .xc-wrap { flex: 1 1 0; min-width: 0; }
  .toolbar > .ann-dates > .xc-wrap input { width: 100% !important; min-width: 0; height: 42px; }
  .toolbar > .btn {
    flex: 1 1 auto;
    width: auto !important;
    min-width: 84px;
    height: 40px;
    padding: 0 12px;
    justify-content: center;
    font-size: 13px;
  }
  .toolbar > .sep { display: none; }
  .toolbar > .hint,
  .toolbar > b,
  .toolbar > label,
  .toolbar > span:not(.xc-wrap):not(.ann-date-sep):not(.tag) { flex: 1 1 100%; }
  .toolbar > .ann-date-sep { flex: 0 0 auto; font-size: 12px; color: #94a3b8; }
  .toolbar > .btn.primary { flex: 1 1 auto; }

  .filters-panel { padding: 12px !important; }
  .filters-panel .btn { height: 36px; }

  /* 标讯筛选条 */
  .ann-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
  }
  .ann-filter select { flex: 1 1 calc(50% - 4px); min-width: 0; height: 42px; }
  .ann-filter input[type="text"],
  .ann-filter input:not([type]) { flex: 1 1 100%; min-width: 0 !important; width: 100%; height: 42px; }
  .ann-dates { flex: 1 1 100%; gap: 8px; }
  .ann-filter .ann-dates input[type="date"] { flex: 1 1 0; width: auto !important; min-width: 0; height: 42px; }
  .ann-dates > .xc-wrap { flex: 1 1 0; min-width: 0; width: auto; }
  .ann-dates > .xc-wrap input { width: 100% !important; min-width: 0; }
  .ann-filter .ann-date-sep { flex: 0 0 auto; font-size: 12px; color: #94a3b8; }
  .ann-filter .btn { flex: 1 1 auto; height: 40px; justify-content: center; margin-left: 0 !important; }

  /* ---------------- 统计条 ---------------- */
  .list-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    overflow: hidden;
    border-radius: 12px;
  }
  .list-stats .ls-item {
    flex: 1 1 50%;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid #f0f1f4;
  }
  .list-stats .ls-item:nth-child(odd) { border-right: 1px solid #f0f1f4; }
  .list-stats .ls-stage {
    flex: 1 1 100%;
    padding: 10px 14px 12px;
    border-top: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 4px;
  }
  .ls-v { font-size: 20px; line-height: 28px; }
  .ls-c { font-size: 11px; line-height: 16px; }

  /* ---------------- KPI ---------------- */
  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
  }
  .kpi-card { padding: 13px 12px; border-radius: 12px; }
  .kc-num { font-size: 22px; line-height: 30px; }
  .kc-title { font-size: 12px; }
  .kc-sub { font-size: 11px; }
  .kpi-card .bid-scroll { max-height: 120px; overflow-y: auto; }

  .kpi-hero { padding: 16px 14px; border-radius: 12px; gap: 12px; }
  .kh-title { font-size: 15px; }
  .kh-num { font-size: 26px; line-height: 34px; }
  .kh-stats { gap: 16px 22px; flex-wrap: wrap; }
  .kh-stat { min-width: 0; }

  .dash-head { padding: 14px; border-radius: 12px; }
  .dh-date { font-size: 17px; line-height: 26px; }
  .dh-right { gap: 8px; }
  .dh-right .btn { height: 38px; }

  /* 四个一批看板 */
  .batch4 { grid-template-columns: 1fr; }
  .batch-card { padding: 14px; }

  /* 批量条 */
  #batchBar { gap: 8px !important; flex-wrap: wrap; }
  #batchBar .btn { height: 34px; }
  /* 「批量修改时间」是次要动作，降为浅蓝，避免和「查询 / 新增项目」抢眼 */
  #batchBar .btn.primary {
    background: #eff5ff;
    color: #2563eb;
    border-color: #c7ddfd;
    box-shadow: none;
  }

  /* ---------------- 表格 ---------------- */
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl th { padding: 9px 8px; font-size: 12px; }
  .tbl td { padding: 9px 8px; font-size: 12px; line-height: 1.5; }
  .card table.tbl:has(thead) { min-width: 680px; }
  .wide-tbl { min-width: 760px; }
  .batch-tbl { min-width: 680px; }
  .tbl .num { white-space: nowrap; }

  /* 标讯列表：手机上表格改为逐条卡片式，避免横向滚动 */
  .ann-tbl { display: block; width: 100%; min-width: 0 !important; table-layout: auto; border-collapse: separate; border-spacing: 0; }
  .ann-tbl thead { display: none; }
  .ann-tbl tbody { display: block; }
  .ann-tbl tbody tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    column-gap: 10px;
    row-gap: 4px;
    padding: 12px 2px 13px;
    border-bottom: 1px solid #f1f3f7;
  }
  .ann-tbl tbody tr:last-child { border-bottom: 0; }
  .ann-tbl tbody tr td {
    display: block;
    border: 0 !important;
    padding: 0 !important;
    background: none !important;
    height: auto;
    white-space: normal;
  }
  .ann-tbl td:nth-child(1) { grid-column: 1; grid-row: 1; font-size: 12px; line-height: 18px; color: #8b93a1; }
  .ann-tbl td:nth-child(2) { grid-column: 2; grid-row: 1; line-height: 18px; }
  .ann-tbl td:nth-child(3) { grid-column: 1; grid-row: 3; font-size: 11px; line-height: 16px; color: #9aa3b2; }
  .ann-tbl td:nth-child(4) { grid-column: 2; grid-row: 3; font-size: 11px; line-height: 16px; color: #9aa3b2; }
  .ann-tbl td:nth-child(5) { grid-column: 1 / -1; grid-row: 2; font-size: 14px; line-height: 21px; font-weight: 500; color: #0f172a; word-break: break-word; }
  .ann-tbl td:nth-child(6) { display: none; }
  .ann-tbl td:nth-child(7) { grid-column: 3; grid-row: 1; justify-self: end; font-size: 13px; font-weight: 600; color: #1d4ed8; }
  .ann-tbl td:nth-child(8) { grid-column: 3; grid-row: 3; justify-self: end; }
  .ann-tbl td:nth-child(8) .ann-origin { height: 24px; font-size: 11px; }
  .ann-tbl tbody tr td.empty {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    text-align: center;
    padding: 28px 0 !important;
    color: #8b93a1;
    font-size: 13px;
  }
  .ann-tbl tbody tr:hover { background: transparent; }
  html[data-theme="dark"] .ann-tbl td:nth-child(5) { color: #e9ebef; }

  /* ---------------- 项目明细 / 领导拜访：手机端卡片列表 ---------------- */
  .m-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
  .card.m-hide { display: none !important; }
  .m-card {
    background: #ffffff;
    border: 1px solid #e6eaf2;
    border-radius: 12px;
    padding: 12px 14px 11px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .m-card .mc-head { display: flex; align-items: flex-start; gap: 8px; }
  .m-card .mc-title {
    flex: 1 1 auto; min-width: 0;
    font-size: 14px; line-height: 21px; font-weight: 600; color: #0f172a;
    text-decoration: none; word-break: break-word;
  }
  .m-card .mc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
  .m-card .mc-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
    font-size: 12px; line-height: 18px; color: #64748b;
  }
  .m-card .mc-meta > i { width: 3px; height: 3px; border-radius: 50%; background: #cbd5e1; font-style: normal; }
  .m-card .mc-meta .tag { height: 20px; padding: 0 8px; font-size: 11px; }
  .m-card .mc-links { display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 18px; }
  .m-card .mc-links a { color: #2563eb; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-card .mc-note {
    margin: 0; font-size: 12px; line-height: 18px; color: #8b93a1;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .m-card .mc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
  .m-card .mc-amt { display: flex; align-items: baseline; gap: 2px; }
  .m-card .mc-amt b { font-size: 17px; line-height: 24px; font-weight: 600; color: #2563eb; font-variant-numeric: tabular-nums; }
  .m-card .mc-amt span { font-size: 11px; color: #94a3b8; }
  .m-card .mc-ops { display: flex; gap: 6px; flex: none; }
  .m-card .mc-ops .btn { height: 32px; min-width: 60px; padding: 0 10px; font-size: 12px; }
  .m-empty {
    padding: 28px 16px; text-align: center; color: #8b93a1; font-size: 13px;
    background: #ffffff; border: 1px solid #e6eaf2; border-radius: 12px;
  }
  html[data-theme="dark"] .m-card { background: #1f1f1f; border-color: #2f3237; }
  html[data-theme="dark"] .m-card .mc-title { color: #e9ebef; }
  html[data-theme="dark"] .m-card .mc-meta { color: #9aa3b2; }
  html[data-theme="dark"] .m-card .mc-meta > i { background: #3a3f46; }
  html[data-theme="dark"] .m-card .mc-note { color: #97a0af; }
  html[data-theme="dark"] .m-empty { background: #1f1f1f; border-color: #2f3237; color: #97a0af; }

  /* 系统管理：功能入口压缩成一行一条，页签收紧 */
  .set-tiles { grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; }
  .set-tiles .card { margin-bottom: 0; padding: 12px 14px; border-radius: 12px; }
  .set-tiles .card-head { margin-bottom: 4px; gap: 10px; }
  .set-tiles .ch-icon { width: 32px; height: 32px; border-radius: 9px; }
  .set-tiles .ch-title { font-size: 15px; line-height: 22px; }
  #unitOwnerBox { overflow-x: auto; }
  #unitOwnerBox table { min-width: 0 !important; width: 100%; table-layout: fixed; }
  #unitOwnerBox table th:nth-child(1), #unitOwnerBox table td:nth-child(1) { width: 34% !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #unitOwnerBox table th:nth-child(2), #unitOwnerBox table td:nth-child(2) { width: 52px !important; }
  #unitOwnerBox table th:nth-child(3), #unitOwnerBox table td:nth-child(3) { width: auto !important; }
  #unitOwnerBox table th:nth-child(4), #unitOwnerBox table td:nth-child(4) { width: 64px !important; }
  #unitOwnerBox table td { padding: 8px 8px; }
  #unitOwnerBox table input { width: 100% !important; min-width: 0; }

  /* 空状态收紧 */
  .bb-empty { padding: 36px 16px; }
  .tbl:has(tbody td.empty) thead { display: none; }
  .tbl:has(tbody td.empty) { min-width: 0 !important; width: 100%; background: transparent; }
  .tbl td.empty { text-align: left; padding: 20px 8px !important; background: transparent !important; }
  .tbl tbody tr:hover td.empty { background: transparent !important; }
  .tbl td.empty::before { margin: 0 0 10px; }

  /* 分页 */
  .pager {
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    margin-top: 12px;
    padding-top: 10px;
    flex-wrap: wrap;
  }
  .pager .pg-size { margin-left: 0; }

  .pager .btn { height: 34px; min-width: 34px; }
  .pager .pg-pos { min-width: 72px; }
  .pager .pg-jump-input { height: 34px; width: 48px; }
  .pager .pg-size { height: 34px; }

  /* ---------------- 页签：系统管理换行显示，标讯横滑 ---------------- */
  .set-tabs {
    flex-wrap: wrap;
    gap: 6px;
    overflow-x: visible;
    padding-bottom: 4px;
  }
  .ann-lg-tabs,
  .ann-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .ann-lg-tabs::-webkit-scrollbar,
  .ann-tabs::-webkit-scrollbar { display: none; }
  .set-tab, .ann-lg-tab, .ann-tab { flex: 0 0 auto; }
  .ann-lg-tabs { gap: 4px; }
  .ann-tab { padding: 5px 8px; font-size: 12px; }
  .set-tab { padding: 7px 10px; font-size: 12px; }

  /* ---------------- 详情页 ---------------- */
  .stage-card { padding: 14px; }
  .s9 { grid-template-columns: repeat(9, 84px) !important; overflow-x: auto; }
  .s9-name { font-size: 11px; }
  .s9-date { font-size: 10px; }
  .amt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .amt-cell { padding: 10px 12px; }
  .amt-cell b { font-size: 16px; }
  .kv-long { flex-direction: column; gap: 2px; padding: 9px 0; }
  .kv-long > span { flex: none; font-size: 12px; }
  .kv-long > p { font-size: 13px; }
  .stage-bar { margin-top: 12px; }

  /* ---------------- 汇报 / 通报 ---------------- */
  .brief-hero { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .bh-item { padding: 12px 8px; }
  .bh-v { font-size: 20px; line-height: 28px; }
  .report-paper { padding: 18px 12px; border-radius: 12px; overflow-x: auto; }
  .report-title { font-size: 20px; line-height: 28px; letter-spacing: .5px; }
  .report-sub { font-size: 11px; margin: 6px 0 14px; }
  .report-sec-title { font-size: 13px; margin: 16px 0 8px; }
  .report-tbl th, .report-tbl td { padding: 5px 4px; font-size: 11px; }
  .report-summary { padding: 12px 14px; }
  .rs-text { font-size: 12px; line-height: 1.9; }
  .rep-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .rep-kpi b { font-size: 18px; }

  /* ---------------- 弹窗：底部抽屉 ---------------- */
  .modal-mask {
    padding: 0;
    align-items: flex-end;
    overflow: hidden;
    backdrop-filter: blur(2px);
  }
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
    border: 0;
    display: flex;
    flex-direction: column;
    animation: sheetUp .3s var(--ease) both;
  }
  .modal.wide { width: 100%; }
  .modal .m-head {
    padding: 14px 16px 12px;
    flex: none;
  }
  .modal .m-head b { font-size: 16px; line-height: 24px; }
  .modal .m-close { width: 36px; height: 36px; }
  .modal .m-body {
    padding: 14px 16px;
    max-height: none;
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal .m-foot {
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    flex-wrap: wrap;
    flex: none;
  }
  .modal .m-foot .btn { flex: 1 1 auto; height: 40px; justify-content: center; }
  @keyframes sheetUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
  }
  .modal-mask.show .modal { animation: sheetUp .3s var(--ease) both; }

  /* 表单改为上下结构 */
  .form-row { grid-template-columns: 1fr; gap: 4px; margin-bottom: 12px; }
  .form-row label { text-align: left; white-space: normal; font-size: 12px; }
  .form-2col, .form-3col { grid-template-columns: 1fr; }
  .form-2col .form-row, .form-3col .form-row { grid-template-columns: 1fr; }
  .form-section { padding: 12px 12px 2px; }
  .fs-title { display: block; font-size: 13px; line-height: 20px; }
  .fs-title .fs-sub { display: block; margin: 2px 0 0; font-size: 11.5px; line-height: 17px; }

  /* 弹窗内的阶段计划表：列宽按手机重排，避免撑破抽屉 */
  .m-body .tbl { width: 100%; table-layout: fixed; }
  .m-body .tbl th:nth-child(1), .m-body .tbl td:nth-child(1) { width: auto !important; }
  .m-body .tbl th:nth-child(2), .m-body .tbl td:nth-child(2) { width: 33% !important; }
  .m-body .tbl th:nth-child(3), .m-body .tbl td:nth-child(3) { width: 33% !important; }
  .m-body .tbl th:nth-child(4), .m-body .tbl td:nth-child(4) { width: 50px !important; }
  .m-body .tbl td:nth-child(2) > *,
  .m-body .tbl td:nth-child(3) > * { display: block; width: 100% !important; }
  .m-body .tbl td:nth-child(2) > .btn,
  .m-body .tbl td:nth-child(3) > .btn { margin: 4px 0 0; height: 26px; font-size: 11px; }
  .m-body .tbl input[type="date"] { width: 100% !important; min-width: 0; height: 36px; font-size: 12px; padding: 0 4px; }
  .m-body .tbl td { padding: 8px 4px; font-size: 11px; }
  .m-body .tbl th { padding: 8px 4px; font-size: 11px; }

  /* 输入控件：16px 避免 iOS 自动放大 */
  input:where(:not([type="checkbox"]), :not([type="radio"]), :not([type="file"])),
  select,
  textarea { font-size: 16px; height: 42px; border-radius: 10px; }
  textarea { height: auto; padding: 10px 12px; }
  .edit-input { height: 32px; font-size: 14px; border-radius: 6px; }
  .modal .m-body input,
  .modal .m-body select,
  .modal .m-body textarea { font-size: 16px; }

  /* 按钮触控尺寸 */
  .btn { height: 36px; font-size: 13px; }
  .btn.sm { height: 32px; font-size: 12px; }

  /* 空状态 */
  .empty, .bb-empty { padding: 32px 12px; }

  /* 表格滚动容器提示 */
  .card::-webkit-scrollbar { height: 4px; }

  /* 关掉 hover 位移，避免触屏残留 */
  .kpi-card:hover, .batch-card:hover, .bb-item:hover, .bh-item:hover,
  .f4-seg:hover, .kc:hover, .stat-item:hover { transform: none; }
}

/* ---------------- 手机（≤640px） ---------------- */
@media (max-width: 640px) {
  .content { padding: 12px 10px calc(20px + env(safe-area-inset-bottom)); }
  .card { padding: 12px; }
  .topbar .title { font-size: 15px; }

  .kpi-row { gap: 8px; }
  .kpi-card { padding: 12px 10px; }
  .kc-num { font-size: 20px; line-height: 28px; }
  .kc-title { font-size: 11.5px; gap: 5px; }

  .list-stats .ls-item { padding: 10px 12px; }
  .ls-v { font-size: 18px; line-height: 26px; }

  .brief-hero { gap: 8px; }
  .bh-v, .bh-v.teal { font-size: 18px; line-height: 26px; }
  .bh-c { font-size: 10.5px; }

  .dash-head { padding: 12px; }
  .dh-date { font-size: 16px; line-height: 24px; }

  .toolbar > select { flex: 1 1 calc(50% - 4px); max-width: calc(50% - 4px); }
  .toolbar > .btn { min-width: 72px; padding: 0 10px; }

  .pager .pg-jump { display: none; }
  .pager .pg-total { font-size: 11px; }

  .modal { max-height: 94dvh; }
  .m-foot .btn { min-width: 96px; }

  .report-paper { padding: 14px 8px; }
  .report-title { font-size: 18px; line-height: 26px; }

  .set-tiles { grid-template-columns: 1fr; }
  .s9 { grid-template-columns: repeat(9, 78px) !important; }
}

/* ---------------- 小屏（≤400px） ---------------- */
@media (max-width: 400px) {
  .topbar { padding: 0 8px 0 4px; }
  .topbar .title { font-size: 14px; }
  .topbar .btn.sm { padding: 0 9px; font-size: 12px; }
  .card { padding: 10px; }
  .content { padding: 10px 8px calc(18px + env(safe-area-inset-bottom)); }
  .kpi-card { padding: 10px 9px; }
  .kc-num { font-size: 19px; }
  .toolbar > .btn { min-width: 66px; }
  .ls-item { flex: 1 1 100%; border-right: 0 !important; }
}

/* 桌面端不显示移动专属控件 */
@media (min-width: 901px) {
  .nav-toggle { display: none !important; }
  .nav-backdrop { display: none !important; }
}

/* 触屏设备去掉卡片 hover 阴影跳变 */
@media (hover: none) {
  .card:hover { border-color: var(--border); box-shadow: 0 1px 2px rgba(15, 23, 42, .03); }
}
