/* ===== 前台全面手机版优化 ===== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

@media (max-width: 768px) {
  body { font-size: 15px; }
  .container, .page-wrap { padding: 0 12px !important; }
  .header-inner { padding: 8px 12px !important; }
  .header { height: auto !important; min-height: 56px !important; }
  
  /* Product grid */
  .products-grid, .product-grid, .bk-products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .product-card, .bk-product-card { border-radius: 8px !important; }
  .product-card img, .bk-product-card img { aspect-ratio: 1 !important; }
  .product-name, .bk-prod-name { font-size: 0.8rem !important; }
  .product-price, .bk-prod-price { font-size: 0.85rem !important; }
  
  /* Product detail */
  .pd-layout, .product-layout { flex-direction: column !important; }
  .pd-images, .pd-info { width: 100% !important; }
  .pd-images { max-width: 100% !important; }
  .pd-title, h1.product-name { font-size: 1.1rem !important; }
  .pd-price, .product-price-main { font-size: 1.3rem !important; }
  .pd-desc, .product-description { font-size: 0.85rem !important; line-height: 1.6 !important; }
  
  /* Checkout */
  .checkout-layout, .checkout-grid { flex-direction: column !important; }
  .checkout-form, .checkout-summary { width: 100% !important; }
  .checkout-header h1 { font-size: 1.2rem !important; }
  .checkout-section { padding: 0.8rem !important; }
  
  /* Cart */
  .cart-layout { flex-direction: column !important; }
  .cart-items, .cart-summary { width: 100% !important; }
  .cart-item { padding: 0.6rem !important; gap: 0.5rem !important; }
  .cart-item img { width: 60px !important; height: 60px !important; }
  
  /* Forms */
  input, select, textarea, button { font-size: 16px !important; }
  .form-row { flex-direction: column !important; gap: 0.5rem !important; }
  .form-group { margin-bottom: 0.5rem !important; }
  
  /* Buttons */
  .btn, button.btn, a.btn { padding: 0.5rem 0.8rem !important; font-size: 0.85rem !important; min-height: 44px !important; }
  .btn-lg { padding: 0.6rem 1rem !important; }
  
  /* Member */
  .member-layout, .member-grid { flex-direction: column !important; }
  .member-sidebar, .member-content { width: 100% !important; }
  .member-tabs { overflow-x: auto !important; }
  .tab-btn { font-size: 0.8rem !important; padding: 0.4rem 0.6rem !important; }
  
  /* Blog / Categories */
  .blog-grid, .post-grid { grid-template-columns: 1fr !important; gap: 0.8rem !important; }
  .post-card { border-radius: 8px !important; }
  .blog-detail, .post-content { padding: 0.8rem !important; font-size: 0.9rem !important; }
  .blog-detail h1 { font-size: 1.3rem !important; }
  
  /* Favorites */
  .fav-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.5rem !important; }
  .fav-wrap { padding: 0.8rem !important; }
  
  /* Monk pages */
  .monk-grid, .monks-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.6rem !important; }
  .monk-card { border-radius: 8px !important; }
  .monk-detail-layout { flex-direction: column !important; }
  
  /* Tables */
  table { font-size: 0.8rem !important; display: block !important; overflow-x: auto !important; }
  th, td { padding: 0.3rem !important; }
  
  /* Footer */
  .footer { padding: 1rem 0.8rem !important; font-size: 0.8rem !important; }
  .footer-grid { flex-direction: column !important; gap: 0.8rem !important; }
  
  /* Navigation */
  .nav-menu, .main-nav { overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; }
  .nav-links { gap: 0.3rem !important; }
  .nav-link { font-size: 0.8rem !important; padding: 0.3rem 0.5rem !important; }
  
  /* Categories page */
  .cat-grid, .categories-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.5rem !important; }
  .cat-card { padding: 0.6rem !important; border-radius: 8px !important; }
}

@media (max-width: 480px) {
  .products-grid, .product-grid, .bk-products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 6px !important; }
  .product-name, .bk-prod-name { font-size: 0.75rem !important; }
  .product-price, .bk-prod-price { font-size: 0.8rem !important; }
  .bk-prod-sku { display: none !important; }
  
  .fav-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .monk-grid, .monks-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .cat-grid, .categories-grid { grid-template-columns: repeat(2, 1fr) !important; }
  
  .pd-title, h1.product-name { font-size: 1rem !important; }
  .pd-price { font-size: 1.1rem !important; }
  
  h1.page-title { font-size: 1.2rem !important; }
  h2, .section-title { font-size: 1rem !important; }
  
  .post-card .post-title { font-size: 0.9rem !important; }
  .post-card .post-excerpt { font-size: 0.8rem !important; }

  /* SSR blocks mobile */
  .categories-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .category-card { padding: 16px 12px !important; }
  .hero-title { font-size: 1.5rem !important; }
  .hero-sub { font-size: 0.85rem !important; }
  .hero-badge { font-size: 0.6rem !important; padding: 4px 12px !important; }
  .section { padding: 40px 12px !important; }
  .section-title { font-size: 1.1rem !important; }
  .page-footer .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 20px !important; }
  .page-footer .footer-bottom { flex-direction: column !important; text-align: center !important; }
  #builderBlocks div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; gap: 20px !important; }
}
