/* 2026-11-25 手机宽度（640px 以下）版：把 site-page-responsive.css 里「平板宽度」的折叠规则用到手机上。
   只有页面里同时有 <html data-mobile-ready> 并引用本文件时才生效；缩放脚本 desktop-scale-fit.js 对 data-mobile-ready 页面全宽度放行。 */
@media (max-width: 640px) {
  html,
  body {
    min-width: 0 !important;
  }

  .header-container {
    min-width: 0 !important;
  }
}

@media (max-width: 640px) {
  html,
  body {
    min-width: 0 !important;
    width: 100% !important;
    overflow-x: clip !important;
  }

  body {
    padding-top: 68px !important;
  }

  body > header {
    display: block !important;
    visibility: visible !important;
    min-height: 68px !important;
    height: 68px !important;
    padding: 8px 0 !important;
    border-bottom: 0 !important;
  }

  body > header .header-container {
    display: flex !important;
    min-width: 0 !important;
    width: 100% !important;
    height: 52px !important;
    padding: 0 18px !important;
    transform: none !important;
  }

  body > header .header-left {
    display: flex !important;
    min-width: 0 !important;
    margin-top: 0 !important;
  }

  body > header .logo img {
    display: block !important;
    width: auto !important;
    height: 46px !important;
    max-width: 230px !important;
  }

  html[data-adaptive-layout] body:not(.admin-page):not(.admin-layout) > header .mobile-menu-toggle {
    display: block !important;
    position: absolute !important;
    top: 5px !important;
    right: 18px !important;
    width: 42px !important;
    height: 42px !important;
    padding: 6px !important;
    border-radius: 8px !important;
    z-index: 10000 !important;
  }

  html[data-adaptive-layout] body:not(.admin-page):not(.admin-layout) > header .mobile-menu-toggle span {
    display: block !important;
    width: 24px !important;
    height: 2px !important;
    margin: 5px auto !important;
  }

  body > header .main-nav {
    display: none !important;
  }

  body > header .main-nav.active {
    display: block !important;
    position: fixed !important;
    inset: 0 0 0 auto !important;
    width: 100% !important;
    height: 100vh !important;
    padding: 78px 22px 32px !important;
    overflow-y: auto !important;
    background: #fff !important;
    box-shadow: -8px 0 28px rgba(15, 23, 42, 0.18) !important;
    z-index: 9999 !important;
  }

  body > header .main-nav.active ul,
  body > header .main-nav.active .mobile-menu-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  body > header .main-nav.active li {
    width: 100% !important;
    border-bottom: 1px solid #e8edf5 !important;
  }

  body > header .main-nav.active > ul > li > a {
    display: block !important;
    padding: 14px 4px !important;
    font-size: 0.94rem !important;
  }

  body > header .main-nav.active .mobile-order-btn {
    display: block !important;
    background: #00aaff !important;
    color: #fff !important;
    padding: 14px 20px !important;
    border-radius: 4px !important;
    font-size: 1rem !important;
    font-weight: bold !important;
    text-align: center !important;
    text-decoration: none !important;
  }

  body > header .main-nav.active .mobile-consult-btn {
    display: block !important;
    color: #00aaff !important;
    padding: 12px 20px !important;
    border: 1px solid #00aaff !important;
    border-radius: 4px !important;
    font-size: 1rem !important;
    font-weight: bold !important;
    text-align: center !important;
    text-decoration: none !important;
  }

  body > header .header-right {
    display: flex !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: 54px !important;
    padding-right: 0 !important;
    gap: 0 !important;
  }

  body > header .header-right > a.header-link,
  body > header #authSection,
  body > header .consult-btn,
  body > header .upload-btn {
    display: none !important;
  }

  body > header .cart-icon,
  body > header .cart-icon a,
  body > header .cart-icon svg {
    display: flex !important;
    width: 24px !important;
    height: 24px !important;
  }

  .vertical-faq-btn {
    display: none !important;
  }

  footer .footer-top {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  footer .footer-brand {
    width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 36px !important;
    padding-right: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  footer .footer-logo {
    margin-left: 0 !important;
    transform: none !important;
  }

  footer .footer-logo img {
    margin-inline: auto !important;
  }

  footer .business-calendar {
    width: min(100%, 300px) !important;
    min-width: 0 !important;
    max-width: 300px !important;
    margin: 18px auto 14px !important;
    transform: none !important;
  }

  footer .footer-links {
    display: grid !important;
    grid-template-columns: 1fr !important;
    justify-items: center !important;
    width: 100% !important;
    gap: 34px !important;
    padding-right: 0 !important;
  }

  footer .footer-col {
    width: 100% !important;
    max-width: 520px !important;
    min-width: 0 !important;
    align-items: center !important;
    text-align: center !important;
  }

  footer .footer-col .footer-main-link {
    width: 100% !important;
    padding-bottom: 9px !important;
    border-bottom: 1px solid #dce5f2 !important;
    color: #234f9a !important;
    font-size: 1rem !important;
  }

  footer .footer-links .footer-col:last-child {
    grid-column: 1 !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    padding-top: 28px !important;
    border-top: 1px solid #e5eaf2 !important;
  }

  footer .footer-bottom {
    flex-direction: column !important;
    gap: 20px !important;
    text-align: center !important;
  }

  footer .footer-legal {
    width: 100% !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px 28px !important;
  }

  /* ここから各ページ固有の調整。 */

  /* company.html */
  .company-reasons .quality-content {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  /* news.html */
  .news-list-row {
    flex-direction: column !important;
    gap: 6px !important;
    padding: 16px 20px !important;
  }

  /* order-confirm.html */
  .oc-grid2 {
    grid-template-columns: 1fr !important;
  }

  /* delivery-guide.html / payment-guide.html / shipping-guide.html --
     same template, same class-naming pattern per page. */
  .delivery-summary-grid,
  .payment-method-grid,
  .shipping-summary-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .delivery-row,
  .bank-account-row,
  .shipping-fee-row {
    grid-template-columns: 1fr !important;
  }

  /* ai-shop.html */
  .ai-sidebar {
    display: none !important;
  }

  .ai-body {
    padding: 10px 10px 0 !important;
  }

  /* first-campaign.html */
  .campaign-steps,
  .campaign-cta-buttons,
  .campaign-hero-grid,
  .campaign-intro-layout,
  .campaign-tier-grid,
  .campaign-info-grid,
  .campaign-faq-grid {
    grid-template-columns: 1fr !important;
  }

  .campaign-hero-redesign {
    text-align: center !important;
  }

  .campaign-hero-lead {
    margin: 0 auto !important;
  }

  .campaign-hero-actions {
    justify-content: center !important;
  }

  /* shared-usage-card.html */
  .standard-services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 15px !important;
  }

  .product-features-grid {
    grid-template-columns: 1fr !important;
  }

  /* card-compare.html */
  .compare-table {
    display: block !important;
    overflow-x: auto !important;
  }

  .features-grid,
  .recommendation-grid {
    grid-template-columns: 1fr !important;
  }

  /* design-submission.html */
  .design-style-options {
    flex-direction: column !important;
  }

  .design-style-option {
    min-width: 100% !important;
  }

  .color-picker {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  /* sample-request.html */
  .sample-confirm-actions,
  .sample-form-actions {
    flex-direction: column !important;
  }

  .sample-hero,
  .sample-form-grid {
    grid-template-columns: 1fr !important;
  }

  .sample-submit {
    width: 100% !important;
    min-width: 0 !important;
  }
}


@media (max-width: 640px) {
  body { padding-left: 0 !important; padding-right: 0 !important; }
  img, table, iframe, video { max-width: 100%; }
  .container { width: auto !important; max-width: 100% !important; padding-left: 14px !important; padding-right: 14px !important; margin-left: 0 !important; margin-right: 0 !important; box-sizing: border-box; }
  h1, .page-title { font-size: 1.5rem !important; line-height: 1.4 !important; }
  .news-list-row { display: block !important; }
  table { display: block; overflow-x: auto; }
}

@media (max-width: 640px) {
  /* 说明类页面：内容区在电脑版里左右留了大块空白，手机上收回来 */
  html[data-mobile-ready] body main > .container,
  html[data-mobile-ready] body main .container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  html[data-mobile-ready] body main > .container > section,
  html[data-mobile-ready] body main .container > section {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
  }
}
