/* ============================================================
   mobile.css — 移动端适配（≤768px 平板手机，≤480px 真正手机）
   通过模板 <link> 引入；不影响桌面布局
   ============================================================ */

/* ─── 桌面默认隐藏汉堡按钮 ─── */
.navbar .menu-toggle { display: none; }

/* ─── 平板 / 手机（≤768px） ─── */
@media (max-width: 768px) {

  /* 主体留白减少 */
  .main { padding: 16px !important; }

  /* 表格横滚（避免溢出撑破布局） */
  .report-list-table,
  .score-grid table,
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    max-width: 100%;
  }

  /* 触摸目标加大到 Apple HIG / Material 推荐 44px */
  button,
  .btn,
  input[type="button"],
  input[type="submit"],
  .navbar nav a,
  [role="button"] {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 14px;
    touch-action: manipulation;
  }

  /* 卡片 padding 收紧 */
  .card,
  .modal-card,
  .panel {
    padding: 16px;
    border-radius: 12px;
  }

  /* 报告区字体收缩 */
  .report-content { padding: 16px !important; }
  .report-content table { font-size: 12px; }
  .report-content pre {
    font-size: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
  }

  /* 评分网格单列 */
  .score-grid,
  .report-section { grid-template-columns: 1fr !important; }
}

/* ─── 真正手机（≤480px） ─── */
@media (max-width: 480px) {

  /* ── 汉堡菜单 ── */
  .navbar .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    min-height: 40px;
    min-width: 44px;
  }

  .navbar {
    padding: 0 12px !important;
    height: 52px;
  }

  .navbar .logo {
    font-size: 16px;
    margin-right: 0;
  }

  /* nav 默认折叠成下拉 */
  .navbar nav {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    gap: 0;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 99;
  }

  .navbar nav.open { display: flex; }

  .navbar nav a {
    width: 100%;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 15px;
    min-height: 44px;
  }

  /* 标题字号压缩 */
  .section-title { font-size: 16px !important; }
  h1 { font-size: 18px !important; }
  h2 { font-size: 16px !important; }
  h3 { font-size: 15px !important; }

  /* 模态框几乎全屏 */
  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    height: 100%;
    max-height: 100% !important;
    border-radius: 0 !important;
    padding: 16px !important;
  }

  /* 报告区进一步压缩 */
  .report-content { padding: 10px !important; }
  .report-content table th,
  .report-content table td { padding: 6px 4px !important; }

  /* 数字字体（分数等）缩小 */
  .modal-header .modal-total,
  .score-value { font-size: 36px !important; }

  /* 防止 iOS 长按选中 */
  body { -webkit-tap-highlight-color: transparent; }
}

/* ─── detail.html（.header / .nav 不同样式系统） ─── */
@media (max-width: 480px) {
  .header {
    flex-wrap: wrap;
    padding: 12px !important;
  }
  .header h1 { font-size: 15px !important; }
  .header .menu-toggle-detail {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e293b;
    border: none;
    color: #e2e8f0;
    font-size: 20px;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    min-width: 44px;
    min-height: 40px;
  }
  /* detail 的 nav 折叠成第二行下拉 */
  .header > div[style*="display:flex"] {
    width: 100%;
    margin-top: 8px;
    flex-wrap: wrap;
  }
  .header .nav { display: none; width: 100%; flex-wrap: wrap; }
  .header .nav.open { display: flex; }
  .header .nav a {
    flex: 1 0 45%;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* detail 的 score-hero / 信号块单列 */
  .score-hero,
  .signal-levels,
  .scores-grid { grid-template-columns: 1fr !important; flex-direction: column !important; gap: 12px !important; }
  .container { padding: 16px !important; }
  .signal-box { padding: 16px !important; }
  .hero-num { font-size: 36px !important; }
}