/* 手机端适配：窄屏下侧边栏转顶部网格导航（5+4 两行，全部可见），整体放大字号 */
@media (max-width: 760px) {
  .layout { flex-direction: column; height: 100vh; height: 100dvh; }
  .sidebar {
    width: 100%;
    flex-direction: column;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
    padding: 0;
    overflow: hidden;
  }
  /* 品牌名不显示，空间全部让给菜单 */
  .brand { display: none; }
  /* 关键修复：#nav 桌面样式是块级元素，窄屏转为 5 列网格，9 项两行全部直接可见 */
  .sidebar #nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    width: 100%;
  }
  .nav-item {
    width: auto;
    text-align: center;
    white-space: nowrap;
    padding: 12px 2px;
    font-size: 14px;
    border-left: none;
    border-bottom: 3px solid transparent;
  }
  .nav-item.active { border-left: none; border-bottom-color: var(--accent); }
  .sidebar-foot { display: none; }
  .main { padding: 14px 14px 40px; font-size: 16px; }
  body { font-size: 16px; }
  .page-title { font-size: 21px; }
  h2 { font-size: 20px; }
  h3 { font-size: 17px; }
  .form { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .trend-grid { grid-template-columns: 1fr !important; }
  .trend-grid.rep { grid-template-columns: 1fr !important; }
  input, select, textarea, button { font-size: 16px; }
  .btn { padding: 12px 18px; }
  .lab-table { font-size: 14px; }
  .lab-table input, .lab-table select { font-size: 14px; padding: 6px 4px; }
  .member-bar .chip { padding: 9px 16px; font-size: 15px; }
  .big-tabs button { padding: 10px 14px; }
  .card { padding: 14px; }
  img { max-width: 100%; height: auto; }
}
