/* ================================================================
   mobile.css — 移动端响应式增强（所有Part共用）
   ================================================================ */

/* ===== 基础布局调整 ===== */
@media (max-width: 767px) {
  html { font-size: 16px; }
  
  /* 导航栏紧凑 */
  .nav-bar { position: sticky; }
  .nav-inner { padding: 0 .75rem; height: 48px; }
  .nav-brand { font-size: .75rem; margin-right: .5rem; }
  .nav-link { padding: 4px 10px; font-size: .7rem; }
  .nav-presenter-btn { display: none; }
  
  /* 内容区边距 */
  .content-section { padding: 2.5rem 1rem; }
  .content-inner { max-width: 100%; }
  
  /* 标题缩放 */
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.2rem; }
  h4 { font-size: 1rem; }
  p { font-size: .9rem; }
  
  /* Hero/Section Divider 缩小 */
  .hero { min-height: 80vh; padding: 2rem 1rem; }
  .hero h1 { font-size: clamp(1.5rem, 6vw, 2rem); }
  .hero-sub { font-size: .9rem; }
  .hero-meta { gap: 1rem; }
  .hero-meta-item { font-size: .75rem; }
  .section-divider { min-height: 40vh; padding: 2.5rem 1rem; }
  .section-divider h2 { font-size: 1.5rem; }
  .section-divider p { font-size: .85rem; }
  .transition-block { padding: 3rem 1rem; }
  .transition-block h2 { font-size: 1.3rem; }
  
  /* ===== 卡片和网格 ===== */
  .knowledge-card { margin-bottom: 1.5rem; }
  .knowledge-card-header { padding: .85rem 1rem; }
  .knowledge-card-header h3 { font-size: .95rem; }
  .knowledge-card-header .num { width: 32px; height: 32px; font-size: .9rem; }
  .knowledge-card-body { padding: 1rem; }
  
  .screenshot-grid { grid-template-columns: 1fr; gap: .75rem; }
  .screenshot-item img { width: 100%; }
  
  .cap-grid { grid-template-columns: 1fr; }
  .summary-cards { grid-template-columns: 1fr; }
  .flow-steps { grid-template-columns: 1fr; gap: .75rem; }
  .flow-step:not(:last-child)::after { display: none; }
  
  .compare-block { grid-template-columns: 1fr; }
  .concept-grid { grid-template-columns: 1fr; }
  .formula-grid { grid-template-columns: 1fr; }
  .practice-grid { grid-template-columns: 1fr; }
  .roadmap-grid { grid-template-columns: 1fr; gap: .5rem; }
  .roadmap-grid::before { display: none; }
  
  /* 工具卡片网格 (part4) */
  .tool-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .tool-card { padding: .75rem; }
  .tool-card h4 { font-size: .8rem; }
  
  /* ===== Prompt框 ===== */
  .prompt-box { padding: .85rem 1rem; font-size: .8rem; line-height: 1.7; }
  .copy-btn { padding: 3px 10px; font-size: .65rem; top: 6px; right: 6px; }
  
  /* ===== 引用块 ===== */
  .quote-block { padding: 2rem 1.25rem; }
  .quote-block .text { font-size: 1.1rem; }
  
  /* ===== 表格可横向滚动 ===== */
  .compare-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  
  /* ===== 内联grid布局适配 ===== */
  div[style*="grid-template-columns: repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
  div[style*="grid-template-columns: repeat(3"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns: repeat(5"] { grid-template-columns: repeat(3, 1fr) !important; }
  div[style*="grid-template-columns:repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
  div[style*="grid-template-columns:repeat(3"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns:repeat(5"] { grid-template-columns: repeat(3, 1fr) !important; }
  div[style*="grid-template-columns: 1fr 1fr;"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns:1fr 1fr;"] { grid-template-columns: 1fr !important; }
  
  /* ===== 时间线 (part2) ===== */
  .timeline-container { padding-left: 1rem; }
  
  /* ===== 架构层 (part3) ===== */
  .arch-layer { padding: 1rem; }
  
  /* ===== 翻车卡片 (part1) ===== */
  .challenge-card { margin-bottom: 1.5rem; }
  .challenge-header { padding: .85rem 1rem; }
  .challenge-header h3 { font-size: .95rem; }
  .challenge-num { width: 32px; height: 32px; font-size: .9rem; }
  .challenge-body { padding: 1rem; }
  .quiz-option-btn { padding: 10px 20px; font-size: .95rem; min-width: 120px; }
  
  /* 投票选项 */
  .poll-options { grid-template-columns: 1fr; }
  .poll-option { font-size: .85rem; padding: .75rem 1rem; }
  
  /* ===== 下载区 (part5) ===== */
  div[style*="grid-template-columns: repeat(5"] a,
  div[style*="grid-template-columns:repeat(5"] a {
    padding: .6rem;
  }
  
  /* ===== 讲演模式在手机上禁用 ===== */
  body.presenter-mode h1 { font-size: inherit; }
  body.presenter-mode h2 { font-size: inherit; }
  body.presenter-mode h3 { font-size: inherit; }
  body.presenter-mode p, body.presenter-mode li { font-size: inherit; }
  body.presenter-mode .content-inner { max-width: 100%; }
}

/* ===== 小屏手机（<=480px）进一步缩紧 ===== */
@media (max-width: 480px) {
  .content-section { padding: 2rem .75rem; }
  .tool-grid { grid-template-columns: 1fr; }
  div[style*="grid-template-columns: repeat(4"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns:repeat(4"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns: repeat(5"] { grid-template-columns: repeat(2, 1fr) !important; }
  div[style*="grid-template-columns:repeat(5"] { grid-template-columns: repeat(2, 1fr) !important; }
  .nav-links { gap: 0; }
  .nav-link { padding: 4px 8px; font-size: .65rem; }
}
