/* ============================================================
   善契同行 · 手机版增强样式（m4.css）
   - 只在 ≤720px 生效，桌面版零影响
   - 视觉沿用 sq.css 令牌：青绿主色 / 宋体标题 / 细边框白卡
   - 布局：大标题 + 分组列表 + 底部标签栏（工作台/社群/我的）
   ============================================================ */
@media (max-width: 720px) {

  /* ---------- 全局骨架 ---------- */
  html { -webkit-text-size-adjust: 100%; }
  body { background: var(--bg); }
  .wrap { padding: 6px 14px 92px !important; max-width: none; }
  .wrap-inner { justify-content: flex-start !important; }
  .top-in { height: 52px; padding: 0 14px; gap: 8px; }
  .brand { font-size: 15px; gap: 7px; }
  .brand img { width: 24px; height: 24px; }
  .top-right { display: none !important; }
  .top-back {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; margin-left: -6px; margin-right: 2px;
    color: var(--fg); font-size: 26px; line-height: 1; text-decoration: none;
  }
  .top-back:hover { text-decoration: none; }
  #crumb { display: none !important; }
  .page-head { margin: 0 0 12px !important; }
  .page-head h1, .wrap h1 { font-family: var(--serif); font-size: 26px; line-height: 1.28; letter-spacing: 0; }
  .page-head .sub { font-size: 12.5px; margin-top: 4px; }
  h2 { font-size: 18px; }
  .card { border-radius: 14px; padding: 14px; }
  .footer-bar { display: block !important; text-align: center; padding: 16px 0 10px; }
  .footer-bar .foot-row1 { display: flex !important; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; }
  .footer-bar .foot-icp { display: block !important; margin-top: 2px; font-size: 11px; }

  /* ---------- 底部标签栏 ---------- */
  .sq-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: flex; height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255,255,255,.97); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .sq-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding-top: 7px; color: var(--faint);
    font-size: 10.5px; font-weight: 500; text-decoration: none;
  }
  .sq-tab:hover { text-decoration: none; }
  .sq-tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .sq-tab.on { color: var(--t); font-weight: 600; }

  /* ---------- 首页工作台 ---------- */
  .hero { display: block !important; padding: 0 !important; }
  .hero svg { display: none !important; }
  .hero h1 { font-size: 27px; }
  .hero .sub { margin-top: 4px; font-size: 12.5px; color: var(--label2); }
  #geoText { font-size: 11.5px !important; }
  .next {
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
    padding: 13px 14px; margin: 12px 0 0; gap: 10px;
  }
  .next .lbl { font-size: 11px; color: var(--t); }
  .next .txt { font-size: 14.5px; }
  .next .go { display: none; }
  .next::after { content: '›'; color: #c8d0c8; font-size: 18px; line-height: 1; }
  .blocks { display: block !important; margin-top: 14px !important; }
  .block {
    display: flex !important; flex-direction: row !important; align-items: center; gap: 12px;
    min-height: 58px; padding: 11px 14px !important; margin-bottom: 10px;
    border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
    transform: none !important; box-shadow: none !important;
  }
  .block::after { content: '›'; color: #c8d0c8; font-size: 18px; line-height: 1; flex: none; }
  .blk-top {
    flex: 1; min-width: 0; min-height: 0 !important; padding: 0 !important;
    background: transparent !important; display: flex; align-items: center; gap: 11px;
    overflow: visible; flex-direction: row !important;
  }
  .blk-top .glyph { display: none !important; }
  .blk-top .name {
    font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--fg);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .blk-top .desc { display: none !important; }
  .blk-bd { display: none !important; }
  .blk-foot { display: none !important; }

  /* ---------- 画像页 ---------- */
  .pf-grid { display: block !important; }
  .pf-card { margin-bottom: 12px; }
  .pf-left { display: none !important; }
  .pf-body { display: block !important; }
  .pf-right { width: 100%; }
  .pf-hd { padding: 0 0 8px !important; }
  .pf-hd h2 { font-family: var(--serif); font-size: 18px; }
  .pf-detail { display: none !important; }
  .addr-line { font-size: 11.5px; }
  .page-head > div:first-child .addr-line { flex-wrap: wrap; }

  /* ---------- 社群 ---------- */
  #subline { display: none !important; }
  .head { padding: 2px 0 0 !important; }
  .tabs { display: flex !important; gap: 8px; overflow-x: auto; padding: 2px 0 10px; -webkit-overflow-scrolling: touch; }
  .tabs .tab { border-radius: 18px; padding: 5px 12px; font-size: 13px; white-space: nowrap; flex: none; }
  .filters { display: flex !important; gap: 8px; overflow-x: auto; align-items: center; padding-bottom: 8px; white-space: nowrap; }
  .filters .chip { flex: none; font-size: 12.5px; padding: 4px 10px; border-radius: 14px; }
  .grid { display: block !important; }
  .grid .card {
    display: flex !important; flex-direction: row !important; align-items: stretch;
    margin-bottom: 10px; border-radius: 14px; overflow: hidden;
  }
  .grid .card .cover { width: 96px; height: 96px; flex: none; font-size: 14px; border-radius: 0; }
  .grid .card .cbody { flex: 1; min-width: 0; padding: 10px 12px; }
  .grid .card .ctitle { font-size: 15px; }
  .grid .card .cmeta { font-size: 11.5px; margin-top: 2px; }
  .grid .card .cq, .grid .card .skill { display: none !important; }
  .grid .card .cstat { margin-top: 6px; }
  .grid .card .cfoot { display: none !important; }
  .grid .card .badge { top: 6px; right: 6px; transform: scale(.86); }
  .minebox h4 { font-size: 14px; }
  .tlist .titem { border-radius: 14px; }

  /* ---------- PBL 列表 ---------- */
  .pj { border-radius: 14px; padding: 13px !important; margin-bottom: 10px; }
  .pj .t { font-size: 15.5px; }
  .pj .t .st { font-size: 11px; }
  .pj .meta { font-size: 12px; margin-top: 3px; }
  .pj .tags { margin-top: 6px; }
  .pj .ft { margin-top: 8px; font-size: 12px; }
  .pj .mini { padding: 3px 8px; font-size: 11.5px; }
  .pj .acts { gap: 6px; }

  /* ---------- 文库 ---------- */
  .lib-head { margin: 0 0 10px !important; }
  .lib-head h1 { font-family: var(--serif); font-size: 26px; }
  .lib-head .sub { display: none !important; }
  .rules { display: none !important; }
  .list .item { padding: 12px 14px; border-radius: 14px; }
  .list .item .l { font-size: 14.5px; }

  /* ---------- 登录后通用列表：详情/记录/表格 ---------- */
  .pf-row { padding: 10px 12px !important; }
  .pf-score { font-size: 16px; }
  .res-item { padding: 10px 12px; }
  .dm-wrap { border-radius: 14px; }
  .dm-log { max-height: 46vh; }

  /* ---------- 详情页（post/topic 已有 mobile2，这里统一节奏） ---------- */
  #gv { padding: 10px 14px 90px !important; }
  .dwrap { grid-template-columns: 1fr !important; gap: 12px !important; }
  .dtitle { font-size: 19px; }
  .pad { padding: 14px 14px !important; }
  .crumbs, .breadcrumb { display: none !important; }

  /* ---------- 我的页 ---------- */
  .me-head { display: flex; align-items: center; gap: 14px; padding: 4px 2px 16px; }
  .me-ava { width: 58px; height: 58px; border-radius: 50%; background: var(--tintbg, #e0f0e8); color: var(--t);
    display: grid; place-items: center; font-family: var(--serif); font-size: 22px; font-weight: 600; flex: none; }
  .me-name { font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.3; }
  .me-sub { font-size: 12.5px; color: var(--label2); margin-top: 2px; }
  .me-group { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
  .me-cell { display: flex; align-items: center; gap: 12px; padding: 14px; min-height: 52px; position: relative; text-decoration: none; color: var(--fg); }
  .me-cell + .me-cell::before { content: ''; position: absolute; left: 14px; right: 0; top: 0; height: 1px; background: var(--line); }
  .me-cell .t { flex: 1; font-size: 15px; }
  .me-cell .v { color: var(--label2); font-size: 13px; }
  .me-cell::after { content: '›'; color: #c8d0c8; font-size: 17px; }
  .me-cell.no-arrow::after { display: none; }
  .me-cell.danger { color: #c0392b; }
  .me-sect { font-size: 12px; color: var(--label2); margin: 16px 6px 8px; }
  .me-foot { text-align: center; color: var(--faint); font-size: 11.5px; margin-top: 18px; line-height: 1.8; }

  /* ---------- 校长助手入口：卡片改列表行 ---------- */
  .pl-grid { display: block !important; margin-top: 12px !important; }
  .pl-card { flex-direction: row !important; align-items: center !important; gap: 12px;
    min-height: 56px !important; padding: 12px 14px !important; margin-bottom: 10px; border-radius: 14px !important; }
  .pl-card:hover { transform: none !important; box-shadow: none !important; }
  .pl-card .n { flex: 1; min-width: 0; font-size: 16px !important; font-weight: 600; }
  .pl-card .d { display: none !important; }
  .pl-card .f { margin-top: 0 !important; flex: none; display: flex; align-items: center; gap: 6px; }
  .pl-card .f .faint { display: none !important; }
  .pl-card .go { display: none !important; }
  .pl-card::after { content: '\203a'; color: #c8d0c8; font-size: 18px; line-height: 1; flex: none; }
  .hintbar { display: none !important; }
  .wrap a[href="/sq/library/index.html"] { font-size: 12.5px !important; padding: 6px 10px !important; border-radius: 8px !important; }
}
