/* FIX10-R1-E | Mobile experience unification | 2026-11-02
   Responsive-only (<= 980px). No new scripts, CTA content or SEO changes.
   Does not alter FOOTER-R1 elements or copy.
*/
@media (max-width: 980px) {
  /* Stable mobile navigation overlay, preserving existing site.js toggle. */
  .site-header { position:relative; z-index:90; }
  .site-header .head-inner { min-width:0; }
  .site-header .brand { min-width:0; max-width:calc(100% - 66px); }
  .site-header .brand small { min-width:0; overflow-wrap:break-word; }
  .site-header .nav-toggle {
    position:relative; z-index:92; flex:0 0 44px; width:44px; height:44px;
    border-radius:8px; touch-action:manipulation;
  }
  .site-header .nav-links {
    z-index:91; box-sizing:border-box; max-height:calc(100vh - 70px);
    max-height:calc(100dvh - 70px); overflow-y:auto; overscroll-behavior:contain;
    box-shadow:0 18px 28px rgba(14,31,49,.13);
  }
  .site-header .nav-links.is-open { visibility:visible; }
  .site-header .nav-links a {
    display:flex; align-items:center; min-height:44px;
    padding-block:9px; border-radius:6px; line-height:1.55;
  }
  .site-header .nav-links a:focus-visible,
  .site-header .nav-toggle:focus-visible {
    outline:2px solid #b58b50; outline-offset:3px;
  }
  /* Article and CMS content: prevent unbroken URLs, tables and images overflowing. */
  main .editable-content, main .full-article, main .article-content,
  main .article-body, main .news-content, main .r2-copy,
  main .r2-detail-copy, main .case-richtext { min-width:0; overflow-wrap:break-word; }
  main :is(.editable-content,.full-article,.article-content,.article-body,.news-content,.case-richtext) img {
    max-width:100%; height:auto;
  }
  main :is(.editable-content,.full-article,.article-content,.article-body,.news-content,.case-richtext) :is(table,pre) {
    display:block; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch;
  }
  main :is(.editable-content,.full-article,.article-content,.article-body,.news-content,.case-richtext) iframe {
    display:block; max-width:100%;
  }
  main :is(.editable-content,.full-article,.article-content,.article-body,.news-content,.case-richtext) blockquote {
    max-width:100%; margin-left:0; margin-right:0;
  }
  main :is(.editable-content,.full-article,.article-content,.article-body,.news-content,.case-richtext) pre {
    white-space:pre; overflow-wrap:normal;
  }
}
@media (max-width: 690px) {
  html { scroll-padding-top:76px; }
  .site-header .brand-primary { line-height:1.25; }
  .site-header .brand small { line-height:1.45; }
  .site-header .nav-links {
    padding:9px 17px 16px;
    border-top:1px solid rgba(27,50,75,.08);
  }
  /* Readable section titles and compact but comfortable columns. */
  main :is(.inner-hero,.r2-overview-hero,.practice-hero) h1 {
    overflow-wrap:break-word; line-height:1.35;
  }
  main :is(.editable-content,.article-body,.full-article,.news-content,.case-richtext) {
    font-size:15px; line-height:1.95;
  }
  main :is(.editable-content,.article-body,.full-article,.news-content,.case-richtext) :is(p,li) {
    line-height:1.95; overflow-wrap:break-word;
  }
  main :is(.editable-content,.article-body,.full-article,.news-content,.case-richtext) :is(h2,h3,h4) {
    line-height:1.5; scroll-margin-top:80px;
  }
  main :is(.editable-content,.article-body,.full-article,.news-content,.case-richtext) figure {
    max-width:100%; margin-inline:0;
  }
  /* Fixed consultation controls: two active actions, native bottom safe area.
     Do not alter visibility of the legacy '整理需求' action or FOOTER-R1. */
  .mobile-bar {
    box-sizing:border-box; min-height:68px;
    height:auto; padding-bottom:calc(8px + env(safe-area-inset-bottom,0px)) !important;
    align-items:center; isolation:isolate;
  }
  .mobile-bar > button[data-copy-wechat],
  .mobile-bar > a[href^="tel:"] {
    touch-action:manipulation; white-space:nowrap;
    min-width:0; min-height:46px; line-height:1.35;
  }
  .mobile-bar > button[data-copy-wechat]:focus-visible,
  .mobile-bar > a[href^="tel:"]:focus-visible {
    outline:3px solid #bf9962; outline-offset:2px;
  }
  .r5-toast { bottom:calc(83px + env(safe-area-inset-bottom,0px)); }
  /* Keep last main-content focus target scrollable above fixed controls. */
  main :is(input,select,textarea,button,a):focus-visible {
    scroll-margin-bottom:calc(90px + env(safe-area-inset-bottom,0px));
  }
}
@media (max-width: 359px) {
  .site-header .nav-links { padding-inline:12px; }
  .mobile-bar { gap:7px !important; padding-inline:8px !important; }
  .mobile-bar > button[data-copy-wechat],
  .mobile-bar > a[href^="tel:"] { font-size:12px !important; letter-spacing:0; }
}
@media (prefers-reduced-motion:reduce) and (max-width:980px) {
  .site-header .nav-links, .site-header .nav-toggle { scroll-behavior:auto; transition:none; }
}

/* WZX FIX10-R1-FINAL-M1 | mobile consult CTA phone background containment.
 * Narrow scope: mobile contact CTA only. Keep original text/number, URL and JS.
 * Reversible single-file patch; no desktop or fixed .mobile-bar styling.
 */
@media (min-width: 360px) and (max-width: 690px) {
  .wzx-footer-r1-cta .wzx-footer-r1-actions {
    grid-template-columns: minmax(0, 1.72fr) minmax(0, .88fr);
    gap: 9px;
  }
  .wzx-footer-r1-cta .wzx-footer-r1-btn-call,
  .wzx-footer-r1-cta .wzx-footer-r1-btn-copy {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 52px;
  }
  .wzx-footer-r1-cta .wzx-footer-r1-btn-call {
    padding-inline: 7px;
    gap: 5px;
    font-size: clamp(11px, 2.85vw, 12px);
    white-space: normal;
  }
  .wzx-footer-r1-cta .wzx-footer-r1-btn-call > span {
    display: block;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.4;
    text-align: center;
  }
  .wzx-footer-r1-cta .wzx-footer-r1-btn-copy {
    padding-inline: 6px;
    gap: 5px;
    font-size: 11.5px;
    white-space: nowrap;
  }
}
