/* 移动端体验补丁：统一间距、触控尺寸与窄屏换行 */
@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  .topbar { gap: 12px; }
  .searchbar { min-width: 0; }
  .searchbar input { min-width: 0; }
  .search-submit { flex: 0 0 auto; min-width: 42px; padding-inline: 9px; }
  .page-heading.split, .section-head { align-items: flex-start; flex-wrap: wrap; }
  .section-head > span { margin-left: auto; }
  .filterbar, .search-page-form, .portal-filter, .forum-filter, .upload-row,
  .form-actions, .form-inline, .workbench-import-form, .blueprint-first-import {
    flex-wrap: wrap;
  }
  .filterbar > input, .filterbar > select, .filterbar > button,
  .portal-filter > input, .portal-filter > select, .portal-filter > button,
  .forum-filter > input, .forum-filter > select, .forum-filter > button,
  .search-page-form > input, .search-page-form > button {
    min-height: 42px;
  }
  .filterbar > input, .portal-filter > input, .forum-filter > input,
  .search-page-form > input { min-width: 0; }
  .detail-actions { flex-wrap: wrap; }
  .detail-actions > .button, .detail-actions > form { flex: 1 1 145px; }
  .detail-actions > form > .button { width: 100%; }
  .row-actions { flex-wrap: wrap; }
  .file-list > div { align-items: flex-start; flex-wrap: wrap; }
  .file-list small { flex-basis: 100%; margin-left: 0; }
  .content { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .mobile-nav {
    height: calc(66px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-nav a { min-width: 48px; min-height: 44px; place-items: center; }
  .mobile-nav small { line-height: 1.2; }
}
@media (max-width: 480px) {
  .page { padding-inline: 14px; }
  .topbar { padding-inline: 12px; }
  .menu-button { flex: 0 0 24px; }
  .searchbar { padding: 7px 10px; }
  .searchbar > span { display: none; }
  .search-submit { width: 34px; min-width: 34px; padding: 0; font-size: 0; }
  .search-submit::before { content: "⌕"; font-size: 18px; }
  .form-actions { display: grid; grid-template-columns: 1fr; }
  .form-actions > .button { width: 100%; }
  .stats-grid a { min-width: 0; }
  .stats-grid small { overflow-wrap: anywhere; }
  .project-card { min-width: 0; }
  .project-card > div:last-child { min-width: 0; }
}
@media (max-width: 700px) {
  .visual-section > header { display: block; }
  .visual-section > header .visual-field { margin-top: 12px; max-width: none; }
  .visual-section > header .visual-field input { width: 100%; min-width: 0; font-size: 18px; }
  .visual-section > header .visual-count { display: block; margin-top: 8px; }
  .visual-section-actions { flex-wrap: wrap; justify-content: flex-start; }
  .visual-section-actions .text-danger { margin-left: 0; }
  .visual-section-actions .button { flex: 1 1 145px; min-height: 40px; }
  .visual-column-editor { width: 100%; min-width: 0; }
  .visual-matrix-wrap { margin-inline: -4px; }
  .visual-matrix input { min-width: 112px; font-size: 14px; }
  .advanced-json { overflow-wrap: anywhere; }
}
/* 工作台补充字段 */
.visual-custom-fields { margin-top:14px; padding-top:12px; border-top:1px solid var(--line); }
.visual-custom-fields-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; color:var(--wine); font-size:13px; }
.visual-custom-field { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) auto; gap:8px; align-items:end; padding:10px; border:1px solid var(--line); border-radius:10px; background:#fbf9f5; }
.visual-custom-field + .visual-custom-field { margin-top:8px; }
.visual-custom-field .visual-field { min-width:0; }
.visual-custom-field .text-danger { white-space:nowrap; }
@media (max-width:700px) {
  .visual-custom-field { grid-template-columns:1fr; }
  .visual-custom-field .text-danger { justify-self:start; }
}
.reply-card-actions { display:flex; align-items:center; gap:10px; }
.reply-card-actions form { margin:0; }
.reply-card-actions .text-danger { padding:0; font-size:12px; }