/* ==========================================================================
   IBC — 简体中文专用样式 (zh-CN only)
   Loaded ONLY by pages under /zh-cn/. English and Vietnamese pages never
   reference this file, so nothing here can affect them.

   Purpose:
   1. Replace the Latin webfont stack with locally-installed CJK system fonts
      (no external font request — Google Fonts is unreliable from Mainland China).
   2. Correct typography that is tuned for Latin text but wrong for Chinese:
      negative letter-spacing, uppercase transforms, wide mono tracking,
      italics, and line-heights that are too tight for dense CJK glyphs.
   ========================================================================== */

:root{
  /* System CJK stack: PingFang (macOS/iOS), HarmonyOS & MS YaHei (Windows),
     Noto/Source Han (Linux/Android). Latin numerals fall back gracefully. */
  /* Latin family is declared FIRST so that Latin runs (IBC, USD 585, +84 ...)
     use a proper Latin face. If the CJK family leads, Windows renders Latin in
     Microsoft YaHei, whose Latin glyphs are noticeably poor. */
  --font-head:"Segoe UI","Helvetica Neue",Arial,"PingFang SC","HarmonyOS Sans SC",
              "Microsoft YaHei","Noto Sans SC","Source Han Sans SC","Hiragino Sans GB",
              "Heiti SC",system-ui,sans-serif;
  --font-body:"Segoe UI","Helvetica Neue",Arial,"PingFang SC","HarmonyOS Sans SC",
              "Microsoft YaHei","Noto Sans SC","Source Han Sans SC","Hiragino Sans GB",
              "Heiti SC",system-ui,sans-serif;
  --font-label:"Segoe UI","Helvetica Neue",Arial,"PingFang SC","HarmonyOS Sans SC",
               "Microsoft YaHei","Noto Sans SC","Source Han Sans SC",system-ui,sans-serif;
}

/* --- body: CJK needs a slightly larger size and looser leading than Latin --- */
body{
  font-family:var(--font-body);
  font-size:16.5px;
  line-height:1.85;
  letter-spacing:0;      /* Han glyphs are full-width and set solid: never track body CJK */
  /* mixed Chinese + Latin (IBC, IRC, USD) must not overflow narrow containers */
  overflow-wrap:break-word;
  word-break:normal;
  line-break:strict;
}

/* --- headings: kill Latin negative tracking, loosen leading, cap weight ---
   CJK glyphs are dense squares; negative letter-spacing makes them collide,
   and 800/900 weights are unavailable in PingFang/YaHei so they synthesise
   badly. 700 is the correct top weight for these stacks. */
h1,h2,h3,h4{
  font-family:var(--font-head);
  letter-spacing:.01em;
  font-weight:700;
}
h1{line-height:1.3;letter-spacing:.01em}
/* Stock Android ships only Regular of Noto Sans CJK, so 600/700 synthesises a
   smeared faux bold. Carry hierarchy on size and colour as well as weight. */
@supports not (font-variation-settings:normal){
  h1,h2,h3{font-weight:700}
}
h2{line-height:1.35;letter-spacing:.01em}
h3{line-height:1.45}
h4{line-height:1.5}
strong,b{font-weight:600}

/* --- small label text that used Space Mono ---
   Latin small-caps tracking (.16em–.22em) is far too wide for Chinese and
   uppercase does nothing to CJK. Retune to a readable CJK label style. */
.eyebrow,.fact .l,.trust-item,.cert-head,.cert-ribbon,.cbd-addr,.contact-lines,
.contact-label,.crumb,.doc-panel .cap,.folder .tag,.foot-label,.init,
.ledger-cell .num,.mega-head,.mini-seal,.mp-label,.nav-phone,.pkg-col h3,
.pkg-legend,.pop-chip,.price-kicker,.quote-card .qc-tag,.route-tag,.seal-stamp,
.spotlight .who,.structure-card .st-tag,.structure-card dt,.trail-step .dur,
.viz .v-mono,.viz .v-num,footer.site h4{
  font-family:var(--font-label);
  letter-spacing:.06em;
  text-transform:none;      /* uppercase is meaningless for Chinese */
}
/* numeric/Latin-only chips keep tighter tracking so figures stay compact */
.fact .n,.service-price strong,.trail-step::before{letter-spacing:0}

/* eyebrows sit above headings: slightly larger so Chinese stays legible */
.eyebrow{font-size:12.5px;font-weight:600;line-height:1.7}
.foot-label{font-size:11px;letter-spacing:.04em}
.crumb{font-size:13px;letter-spacing:.02em}
.pop-chip{font-size:10px;letter-spacing:.02em;padding:3px 8px}
.folder .tag,.structure-card .st-tag{font-size:10.5px;letter-spacing:.03em}
.trail-step .dur,.price-kicker,.route-tag,.quote-card .qc-tag{font-size:12px;letter-spacing:.03em}

/* --- Chinese has no true italic; synthesised obliques look broken --- */
em,i,cite,address{font-style:normal}

/* --- body copy blocks: extra leading, and CJK measure is shorter than Latin.
   65ch of Chinese is an uncomfortably long line, so tighten the measure. --- */
.sec-head p,.svc-prose p,.hero .lede,.lede,.folder p,.ledger-cell p,
.trail-step p,.quote-card p,details p{line-height:1.9}
.svc-prose p{max-width:40em}
.svc-prose ul.checks li{line-height:1.85;font-size:15.5px}
.svc-includes li{line-height:1.8}

/* --- navigation: Chinese-specific typography, layered on the shared master
   header (nav.css). These selectors deliberately name .home-nav-links so they
   sit ON TOP of the master rather than competing with it at equal specificity.
   The old `.nav-links > a,.dd-toggle{padding:9px 12px}` override tied with
   nav.css on the anchors but lost on the dropdown toggle, so the toggle stood
   at a different height from the links and the Chinese nav rendered on two
   uneven rows. Padding now comes from the master; only the CJK letter-spacing
   and size, which are genuine Chinese typography, are set here. --- */
.home-nav-links{font-size:15px}
.home-nav-links > a,.home-nav-links .dd-toggle{letter-spacing:.02em}
.dd-menu b{font-size:14.5px;letter-spacing:.01em}
.dd-menu span.d{font-size:12.5px;line-height:1.6}
.mega-head{font-size:11.5px;letter-spacing:.08em}

/* --- buttons: Chinese labels are compact; keep them on one line --- */
.btn{letter-spacing:.03em;white-space:nowrap}
.btn-sm{font-size:14px}
@media(max-width:620px){
  .btn{white-space:normal;line-height:1.5}
}

/* --- forms: labels and helper text --- */
label{font-size:13.5px;letter-spacing:.02em}
input,select,textarea{font-family:var(--font-body);font-size:15px;letter-spacing:.01em}
.form-note{line-height:1.8}
.field-err{letter-spacing:.02em}

/* --- homepage hero: the Latin build uses hard negative tracking on the
   display headline, which crushes Chinese characters together. --- */
#home-hero-title,.home-hero-title,.hero h1{
  letter-spacing:.015em !important;
  line-height:1.35 !important;
  font-weight:700;
}
/* Chinese is full-width, so the Latin display size overflows the headline
   measure and orphans a character onto its own line. A slightly smaller cap
   keeps the same four-line shape as English and Vietnamese.
   word-spacing collapses the single literal space the Latin markup carries
   between the two clauses — Chinese sets no space there. */
#home-hero-title{
  font-size:clamp(38px,3.4vw,54px) !important;
  word-spacing:-.3em;
}

/* --- mobile: Chinese at small sizes needs more leading, not less --- */
@media(max-width:620px){
  body{font-size:16px;line-height:1.85}
  h1{line-height:1.32}
  h2{line-height:1.4}
  .sec-head p,.hero .lede,.lede{line-height:1.9}
  .eyebrow{font-size:12px}
  /* long Chinese contact rows must not clip */
  .contact-lines .row{word-break:break-word}
}

/* --- tables / pricing: keep figures Latin-tight inside Chinese context --- */
.service-price,.pc .v,.price-tax{letter-spacing:0}

/* --- language selector shows Chinese label --- */
.lang-select{font-family:var(--font-body)}

/* ==========================================================================
   悬浮咨询栏 + 移动端底部操作条 (zh-CN only)
   Persistent conversion surface. Chinese pages only.
   Rendered by zh-contact.js from zh-config.js; channels left blank in the
   config are never rendered, so no placeholder ever reaches a visitor.
   ========================================================================== */
.zh-rail{position:fixed;right:14px;top:50%;transform:translateY(-50%) translateX(20px);
  z-index:140;display:flex;flex-direction:column;gap:8px;opacity:0;visibility:hidden;
  transition:opacity .3s var(--ease-out,ease),transform .3s var(--ease-out,ease),visibility .3s}
.zh-rail.show{opacity:1;visibility:visible;transform:translateY(-50%) translateX(0)}
.zh-rail-item{position:relative;width:60px;height:60px;border:1.5px solid #DCE4EE;background:#fff;
  border-radius:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  cursor:pointer;color:#163A5F;font-family:inherit;box-shadow:0 8px 22px -12px rgba(11,31,51,.28);
  text-decoration:none;padding:0;transition:background .16s,color .16s,border-color .16s}
.zh-rail-item svg{width:21px;height:21px}
.zh-rail-label{font-size:10.5px;font-weight:600;line-height:1.2;letter-spacing:.02em}
.zh-rail-item:hover,.zh-rail-item:focus-visible{background:#163A5F;color:#fff;border-color:#163A5F}
.zh-rail-item:focus-visible{outline:3px solid #B79A5B;outline-offset:2px}
.zh-rail-top{opacity:.85}
.zh-rail-pop{position:absolute;right:calc(100% + 10px);top:50%;transform:translateY(-50%) translateX(6px);
  background:#0B1F33;color:#fff;padding:12px 15px;border-radius:11px;font-size:13px;line-height:1.7;
  white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;text-align:left;
  box-shadow:0 20px 46px -20px rgba(11,31,51,.5);transition:opacity .18s,transform .18s,visibility .18s}
.zh-rail-pop b{display:block;color:#9FB8D4;font-size:11px;font-weight:600;letter-spacing:.06em}
.zh-rail-item:hover .zh-rail-pop,.zh-rail-item:focus-visible .zh-rail-pop{
  opacity:1;visibility:visible;transform:translateY(-50%) translateX(0)}
.zh-rail-pop-wide{white-space:normal;width:186px;text-align:center}
.zh-rail-pop-wide img{display:block;margin:9px auto 7px;border-radius:8px;background:#fff}
.zh-wxid{display:block;font-size:12.5px;margin-top:2px}
.zh-rail-note{display:block;color:#9FB8D4;font-size:11.5px;margin-top:6px;line-height:1.6}

/* mobile sticky action bar */
.zh-bar{display:none;position:fixed;left:0;right:0;bottom:0;z-index:145;background:rgba(255,255,255,.97);
  border-top:1.5px solid #DCE4EE;box-shadow:0 -8px 24px -14px rgba(11,31,51,.3);
  padding:8px 10px calc(8px + env(safe-area-inset-bottom,0px));gap:8px}
.zh-bar-item{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  min-height:48px;border:none;background:none;font-family:inherit;color:#163A5F;font-size:11.5px;
  font-weight:600;text-decoration:none;border-radius:10px;cursor:pointer;padding:6px 4px}
.zh-bar-item svg{width:20px;height:20px}
.zh-bar-item:active{background:#F1F5F9}
.zh-bar-cta{background:#C8372D;color:#fff}
.zh-bar-cta:active{background:#A32A22}
@media(max-width:900px){
  .zh-rail{display:none}
  .zh-bar{display:flex}
  /* keep the sticky bar from covering page content and the footer */
  body{padding-bottom:74px}
}

/* WeChat sheet */
.zh-wx-sheet{position:fixed;inset:0;z-index:190;background:rgba(11,31,51,.55);
  display:none;align-items:center;justify-content:center;padding:22px}
.zh-wx-sheet.open{display:flex}
.zh-wx-card{background:#fff;border-radius:18px;padding:26px 24px 22px;max-width:330px;width:100%;
  text-align:center;position:relative;box-shadow:0 34px 76px -28px rgba(11,31,51,.55)}
.zh-wx-card h3{font-size:19px;font-weight:700;margin-bottom:14px}
.zh-wx-card img{display:block;margin:0 auto;border-radius:10px}
.zh-wx-tip{font-size:13px;color:#4A5A6E;margin-top:11px;line-height:1.7}
.zh-wx-id{font-size:14px;margin-top:10px}
.zh-wx-copy{border:1.5px solid #DCE4EE;background:#F1F5F9;border-radius:7px;padding:3px 11px;
  font-family:inherit;font-size:12.5px;font-weight:600;color:#163A5F;cursor:pointer;margin-left:5px}
.zh-wx-close{position:absolute;top:12px;right:12px;border:none;background:none;cursor:pointer;
  color:#4A5A6E;padding:5px;line-height:0}
.zh-wx-close svg{width:19px;height:19px}
.zh-wx-alt{display:flex;gap:9px;justify-content:center;margin-top:16px;padding-top:15px;
  border-top:1px solid #DCE4EE;flex-wrap:wrap}
.zh-wx-alt a{font-size:13px;font-weight:600;color:#163A5F;border:1.5px solid #DCE4EE;
  border-radius:8px;padding:7px 14px;text-decoration:none}
body.zh-noscroll{overflow:hidden}

@media (prefers-reduced-motion:reduce){
  .zh-rail,.zh-rail-pop{transition:none}
}

/* tap-to-chat button inside the WeChat sheet (phones only) */
.zh-wx-go{display:block;background:#07C160;color:#fff;font-weight:700;font-size:16px;
  padding:14px 20px;border-radius:11px;text-decoration:none;margin:4px 0 4px}
.zh-wx-go:active{background:#06AD56}
