/**
 * @file theme.css
 * Mercury brand theme for 桂林新和科技 (Xinhe Tech).
 * Native Mercury customization: this file sits next to index.php in the web
 * root and overrides the theme's src/theme.css (see mercury CUSTOMIZING.md).
 * shadcn/ui-compatible OKLCH design tokens. Brand palette: corporate blue.
 */

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.13 0.043 265.132);
  --card: oklch(0.967 0.003 264.542);
  --card-foreground: oklch(0.21 0.032 264.665);
  --primary: oklch(0.55 0.20 255);
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.9219 0 0);
  --secondary-foreground: oklch(0.28 0.041 260.329);
  --muted: oklch(0.967 0.003 264.542);
  --muted-foreground: oklch(0.13 0.043 265.132);
  --accent: oklch(0.93 0.04 255);
  --accent-foreground: var(--foreground);
  --destructive: oklch(0.6368 0.2078 25.3313);
  --destructive-foreground: oklch(1 0 0);
  --border: oklch(0.872 0.009 258.338);
  --input: oklch(0.872 0.009 258.338);
  --font-sans: "Outfit", "Helvetica Neue", Arial, Helvetica, sans-serif;
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --font-mono: "Fira Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
  --font-body: "Inter", Arial, Helvetica, sans-serif;
  --radius: 0.5rem;
  --shadow-x: 0;
  --shadow-y: 1px;
  --shadow-blur: 3px;
  --shadow-spread: 0px;
  --shadow-opacity: 0.1;
  --shadow-color: oklch(0 0 0);
  --shadow-2xs: 0 1px 3px 1px hsl(0 0% 0% / 0.05);
  --shadow-xs: 0 1px 3px 1px hsl(0 0% 0% / 0.05), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
  --shadow-sm: 0 1px 3px 1px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
  --shadow: 0 1px 3px 1px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
  --shadow-md: 0 1px 3px 1px hsl(0 0% 0% / 0.1), 0 4px 6px -2px hsl(0 0% 0% / 0.1);
  --shadow-lg: 0 1px 3px 1px hsl(0 0% 0% / 0.1), 0 8px 10px -2px hsl(0 0% 0% / 0.1);
  --shadow-xl: 0 1px 3px 1px hsl(0 0% 0% / 0.1), 0 12px 14px -3px hsl(0 0% 0% / 0.1);
  --shadow-2xl: 0 1px 3px 1px hsl(0 0% 0% / 0.1), 0 16px 18px -3px hsl(0 0% 0% / 0.1);
  --tracking-normal: 0em;
  --spacing: 0.25rem;

  /* Set navbar height for hero billboard overlay */
  --navbar-height: calc(var(--spacing) * 15);

  @media (min-width: 768px) {
    --navbar-height: calc(var(--spacing) * 18);
  }
}

.dark {
  --background: oklch(0.13 0.043 265.132);
  --foreground: oklch(1 0 89.876);
  --card: oklch(0.208 0.042 266.359);
  --card-foreground: var(--foreground);
  --primary: oklch(0.55 0.20 255);
  --primary-foreground: var(--foreground);
  --secondary: oklch(0.704 0.04 256.993);
  --secondary-foreground: oklch(0.13 0.043 265.132);
  --muted: oklch(0.28 0.041 260.329);
  --muted-foreground: oklch(0.967 0.003 264.542);
  --accent: oklch(0.93 0.04 255);
  --accent-foreground: oklch(0.13 0.043 265.132);
  --destructive: oklch(0.6368 0.2078 25.3313);
  --destructive-foreground: oklch(1 0 0);
  --border: oklch(0.373 0.031 259.733);
  --input: oklch(0.373 0.031 259.733);
  --font-sans: "Outfit", "Helvetica Neue", Arial, Helvetica, sans-serif;
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --font-mono: "Fira Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
  --radius: 0.5rem;
  --shadow-x: 0;
  --shadow-y: 1px;
  --shadow-blur: 3px;
  --shadow-spread: 0px;
  --shadow-opacity: 0.1;
  --shadow-color: oklch(0 0 0);
  --shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
  --shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
  --shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
  --shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
  --shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -2px hsl(0 0% 0% / 0.1);
  --shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -2px hsl(0 0% 0% / 0.1);
  --shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 12px 14px -3px hsl(0 0% 0% / 0.1);
  --shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 16px 18px -3px hsl(0 0% 0% / 0.1);
}/* XH-NAV-DROPDOWN — main navigation dropdown presentation.
 * Menu data is native (Structure > Menus); this only styles the dropdown
 * that Mercury's flat menu--main.html.twig lacks. Uses brand design tokens. */
.xh-nav-item { position: relative; }
.xh-nav-trigger {
  display: inline-flex; align-items: center; gap: 0.25rem;
  cursor: pointer; background: none; border: 0; font: inherit; color: inherit;
  width: 100%;
}
.xh-nav-chevron { width: 1rem; height: 1rem; flex: none; transition: transform 0.2s ease; }
.xh-nav-dropdown {
  list-style: none; margin: 0; padding: 0.375rem;
  display: none; flex-direction: column; gap: 0.125rem; min-width: 11rem;
}
.xh-nav-dropdown li { width: 100%; }
.xh-nav-dropdown a, .xh-nav-dropdown span {
  display: flex; align-items: center; min-height: 40px;
  padding: 0.5rem 0.75rem; border-radius: var(--radius);
  white-space: nowrap; text-decoration: none; color: var(--foreground);
  font-size: 0.95rem;
}
.xh-nav-dropdown a:hover, .xh-nav-dropdown a:focus {
  background: var(--primary); color: var(--primary-foreground);
}

/* Desktop: hover / keyboard-focus dropdown panel */
@media (min-width: 768px) {
  .xh-nav-trigger { width: auto; }
  .xh-nav-dropdown {
    position: absolute; top: 100%; left: 0; z-index: 50;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
  }
  .xh-nav-item:hover > .xh-nav-dropdown,
  .xh-nav-item:focus-within > .xh-nav-dropdown { display: flex; }
  .xh-nav-item:hover > .xh-nav-trigger .xh-nav-chevron,
  .xh-nav-item:focus-within > .xh-nav-trigger .xh-nav-chevron { transform: rotate(180deg); }
}

/* Mobile: children render inline (indented) inside the navbar modal */
@media (max-width: 767.98px) {
  .xh-nav, .xh-nav > ul, .xh-nav > ul > li { width: 100%; }
  .xh-nav-item { flex-direction: column; align-items: stretch; }
  .xh-nav-trigger { width: 100%; flex-basis: auto; justify-content: space-between; min-height: 44px; padding: 0.5rem; }
  .xh-nav-dropdown { display: flex; width: 100%; padding-left: 1rem; }
}

/* XH-CANVAS-DESIGN — Drupal-official-style typography & spacing system.
 * Native Mercury brand layer (web-root theme.css overrides src/theme.css).
 * The Canvas pages are flat component lists and Mercury's grid.twig emits no
 * container/margins, so blocks stack with zero spacing. This layer establishes
 * the vertical rhythm, a centered readable measure, a clear type scale and
 * clean card/table/CTA polish site-wide. Everything is driven by the tunable
 * tokens below; ops can adjust spacing/measure without touching markup. */

:root {
  --xh-measure: 1200px;                              /* centered content width */
  --xh-lede-measure: 52rem;                          /* centered intro width */
  --xh-section-gap: clamp(3.5rem, 4vw + 2rem, 6rem); /* space before a new section */
  --xh-block-gap: clamp(1.75rem, 2vw + 1rem, 2.75rem);/* space between blocks */
  --xh-inline-gap: 1rem;                             /* heading -> its lede */
  --xh-body-leading: 1.75;                           /* comfortable prose leading */
  --xh-card-pad: clamp(1.375rem, 1vw + 1rem, 1.875rem);
  --xh-card-radius: 0.875rem;
  --xh-body-soft: oklch(0.40 0.03 265);              /* softer prose color */
  --xh-card-border-hover: oklch(0.55 0.20 255 / 0.45);
  --xh-zebra: oklch(0.975 0.004 265);
  --xh-footer-bg: #0a1a3a;                           /* deep-navy footer band (user: dark, not pale) */
  --xh-footer-heading: #ffffff;                      /* column titles / company name */
  --xh-footer-text: #bdc3c7;                         /* body + links (reference muted light) */
  --xh-footer-muted: #8b98a8;                        /* copyright / slash separators */
  --xh-footer-border: #2c3e50;                       /* row divider on navy */
  --xh-footer-hover: #ffffff;                        /* link hover */
  --xh-cta-a: oklch(0.50 0.20 255);
  --xh-cta-b: oklch(0.58 0.17 235);
}

/* ---- Centered readable measure (CTA bands stay full-bleed) ---- */
.region-content > h1,
.region-content > h2,
.region-content > h3,
.region-content > h4,
.region-content > .font-body,
.region-content > section:not(.cq-full),
.region-content > figure.video-component,
.region-content > .accordion-container {
  width: 100%;
  max-width: var(--xh-measure);
  margin-inline: auto;
}
/* No bottom breathing room: the footer band connects directly to the last block
 * (the level-2 CTA on most pages). User: "页脚与上面可以直接接上不用留白那么多". */
.region-content { padding-bottom: 0; }
/* …EXCEPT /jobs + /contact, which end on plain content (投递简历 prose / FAQ accordion),
 * not a CTA band — there the flush navy footer reads cramped, so keep the old breathing
 * room (user: "这两个页面底下还是按之前留点白，其他页面不动了"). Canvas pages share a generic
 * `path-page` body class (no per-page hook), so scope by each page's unique content:
 * /jobs = the .xh-job-card job cards; /contact = the WeChat QR images. */
.region-content:has(.xh-job-card),
.region-content:has(img[src*="/qr/"]) {
  padding-bottom: clamp(3rem, 3vw + 1.5rem, 5rem);
}

/* ---- Vertical rhythm between flat blocks ---- */
.region-content > * + * { margin-top: var(--xh-block-gap); }
/* a top-level heading opens a new section: generous space above */
.region-content > * + h1,
.region-content > * + h2,
.region-content > * + h3 { margin-top: var(--xh-section-gap); }
/* ...but a top-level h3 that directly follows a section's intro lede is a SUB-heading
 * (title -> lede -> sub-heading -> content), not a new section: tighten the gap above it
 * back to block-gap. (More specific than the rule above, so it wins.) */
.region-content > .font-body + h3 { margin-top: var(--xh-block-gap); }
/* heading -> its intro lede: tight */
.region-content > h1 + .font-body,
.region-content > h2 + .font-body,
.region-content > h3 + .font-body { margin-top: var(--xh-inline-gap); }
/* full-bleed CTA band: generous space above (never the first/hero band) */
.region-content > section.cq-full:not(:first-child) { margin-top: var(--xh-section-gap); }

/* ---- Section heading hierarchy ---- */
.region-content > h1,
.region-content > h2,
.region-content > h3,
.region-content > h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--foreground);
  margin-bottom: 0;
  text-wrap: balance;
}
/* Reference fixed scale (xh.xinhechina.com): section title 30px, subheading 20px,
 * h4 15px. Mercury's responsive clamp grew these to 40/30/22 on desktop — larger
 * than the source — so pin to the source's fixed values at every width. The hero
 * h1 + CTA-band h2 keep their own one-line rules below (deliberately large). */
.region-content > h2 { font-size: 1.875rem; }
.region-content > h3 { font-size: 1.25rem; }
.region-content > h4 { font-size: 0.9375rem; }

/* centered, narrow lede under a CENTERED section title (single paragraph only) */
.region-content > h2.text-center + .font-body:not(:has(table)):not(:has(ul)):not(:has(ol)):not(:has(h2)):not(:has(h3)):not(:has(p + p)):not(:has(.xh-brand-list)),
.region-content > h3.text-center + .font-body:not(:has(table)):not(:has(ul)):not(:has(ol)):not(:has(h2)):not(:has(h3)):not(:has(p + p)):not(:has(.xh-brand-list)) {
  max-width: var(--xh-lede-measure);
  text-align: center;
  color: var(--xh-body-soft);
}

/* ---- Prose typography (text component + rich text) ---- */
.region-content p { line-height: 1.7; }
/* prose base 16px (reference .section-desc), overriding Mercury's text_size
 * utilities that grow it to 18-20px on desktop; p/li inherit this fixed size. */
.region-content .font-body { font-size: 1rem; line-height: var(--xh-body-leading); }
.region-content .font-body p { margin-block: 0 1.1em; }
.region-content .font-body > *:last-child { margin-bottom: 0; }
.region-content .font-body li { margin-bottom: 0.5em; line-height: 1.7; }
.region-content .font-body ul,
.region-content .font-body ol { padding-inline-start: 1.4em; }
.region-content .font-body strong { font-weight: 600; color: var(--foreground); }
.region-content .font-body a { text-underline-offset: 3px; }
.region-content .font-body h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; margin: 1.6em 0 0.6em; }
.region-content .font-body h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.3; margin: 1.4em 0 0.5em; }
.region-content .font-body h4 { font-size: 1rem; font-weight: 600; margin: 1.2em 0 0.4em; }
.region-content .font-body h2:first-child,
.region-content .font-body h3:first-child,
.region-content .font-body h4:first-child { margin-top: 0; }

/* ---- Grid breathing room ---- */
.region-content section:not(.cq-full) .grid { gap: clamp(1.25rem, 1vw + 0.75rem, 2rem); }

/* ---- Cards: clean white, hairline border, soft shadow, hover lift ---- */
.region-content .group.relative.flex.rounded-xl {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--xh-card-radius);
  box-shadow: var(--shadow-xs);
  padding: var(--xh-card-pad);
  gap: 0.875rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.region-content .group.relative.flex.rounded-xl:hover {
  transform: translateY(-4px);
  scale: none; /* clickable cards carry Mercury's hover:scale-103 (Tailwind standalone
                * `scale`), which COMPOSES with the translateY above and reads as a
                * grow/wobble instead of a clean lift. Neutralize it so every card lifts alike. */
  box-shadow: var(--shadow-lg);
  border-color: var(--xh-card-border-hover);
}
.region-content .group.relative.flex.rounded-xl h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
}
.region-content .group.relative.flex.rounded-xl p {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--xh-body-soft);
  margin: 0.625rem 0 0;
}

/* ---- Icon tiles (industry / feature cards) ---- */
.region-content .grid > .\@container {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--xh-card-radius);
  box-shadow: var(--shadow-xs);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.region-content .grid > .\@container:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--xh-card-border-hover);
}
.region-content .grid > .\@container h3 { font-size: 1.125rem; line-height: 1.3; letter-spacing: -0.01em; }
.region-content .grid > .\@container span.font-body { font-size: 0.875rem; color: var(--xh-body-soft); line-height: 1.7; }

/* ---- Pricing cards ---- */
.region-content article.group.relative.flex.flex-col {
  border: 1px solid var(--border);
  border-radius: var(--xh-card-radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(1.5rem, 1vw + 1rem, 2rem);
}

/* ---- Tables: unified 14px cell type (reference .comparison-table th/td = 14px).
 * Mercury prose grew cells to 16px — as big as the lede — so tables read like body
 * copy. Pin table/th/td to 0.875rem so every comparison table site-wide shares one
 * scale: section title 30 / lede 16 / card+cell 14 / fine-print 13. ---- */
.region-content .font-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.875rem; line-height: 1.6; }
.region-content .font-body th { background: var(--accent); color: var(--accent-foreground); font-size: 0.875rem; font-weight: 600; text-align: left; padding: 0.875rem 1rem; border-bottom: 2px solid var(--border); }
.region-content .font-body td { font-size: 0.875rem; padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.region-content .font-body tbody tr:nth-child(even) { background: var(--xh-zebra); }
.region-content .font-body tbody tr:hover td { background: var(--accent); }

/* ---- CTA bands: subtle brand gradient + comfortable leading ---- */
.region-content > section.cq-full {
  background-image: linear-gradient(135deg, var(--xh-cta-a), var(--xh-cta-b));
}
.region-content > section.cq-full p { line-height: 1.6; }
.region-content > section.cq-full + .font-body {
  text-align: center;
  color: var(--xh-body-soft);
  font-size: 0.95rem;
}

/* ---- Buttons: a touch more presence ---- */
.region-content a.group.flex.items-center.justify-center,
.region-content button.group.flex.items-center.justify-center {
  border-radius: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-xs);
}

/* ---- Video ---- */
.region-content figure.video-component { max-width: 56rem; }
.region-content figure.video-component video { border-radius: var(--xh-card-radius); box-shadow: var(--shadow-md); }

/* ---- Accordion (contact FAQ) ---- */
.region-content .accordion-container {
  border: 1px solid var(--border);
  border-radius: var(--xh-card-radius);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.region-content .accordion--title { font-size: 1.125rem; font-weight: 600; padding: 1.125rem 1.25rem; line-height: 1.4; }
.region-content .accordion--content { line-height: 1.7; }

/* ---- Themed scrollbar (brand-neutral) ---- */
html { scrollbar-width: thin; scrollbar-color: oklch(0.72 0.02 265) transparent; }

/* ---- Footer: 4 horizontal cards + centered 3-line copyright ----
 * Mercury's footer.twig splits the top row into a 2-col grid (branding | CTA).
 * We populate only the first slot with a 4-card grid, so let that row span the
 * full width; the empty CTA column collapses to zero height on its own. */
.site-footer > div > div:first-child { display: block; }

/* Full-bleed DEEP-NAVY footer band (user reversed the pale-sky choice: "还是搞成这种深色，
 * 否则头重脚轻" — matches the reference dark footer). The section is a `container mx-auto`
 * (centered, transparent); break it to viewport width + paint the navy, then re-constrain
 * the inner wrapper to the site measure so the columns stay centered. Reference footer is
 * FLAT (no card boxes): light text directly on navy, so the white card chrome is dropped. */
.site-footer {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background: var(--xh-footer-bg);
  padding-top: clamp(2rem, 3vw + 1rem, 3rem);
  padding-bottom: clamp(1.5rem, 2vw + 0.75rem, 2.25rem);
}
.site-footer > div {
  width: 100%;
  max-width: var(--xh-measure);
  margin-inline: auto;
  padding-inline: 1rem;
}
/* Mercury's footer rows carry a light border-t; on navy swap to the dark divider. */
.site-footer > div > div:first-child,
.site-footer > div > div:last-child { border-top-color: var(--xh-footer-border); }

/* flat columns on navy (reference has no card boxes) — keep the grid cell spacing,
 * drop the white surface / border / shadow so text sits directly on the dark band. */
.site-footer .grid > div.flex.flex-col {
  align-self: stretch;
  height: 100%;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: clamp(1.25rem, 1vw + 0.75rem, 1.5rem);
  gap: 0.75rem;
}
.site-footer .grid h3,
.site-footer .grid h4 {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0;
  color: var(--xh-footer-heading);
}
/* link lists (产品 / 服务) + contact list */
.site-footer .grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.site-footer .grid ul li { margin: 0; font-size: 0.95rem; line-height: 1.5; }
.site-footer .grid ul a {
  color: var(--xh-footer-text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}
.site-footer .grid ul a:hover { color: var(--xh-footer-hover); }
/* company intro + contact prose */
.site-footer .grid .font-body { font-size: 0.95rem; color: var(--xh-footer-text); line-height: 1.7; }
.site-footer .grid .font-body p { margin: 0; }
.site-footer .grid .font-body li { font-size: 0.95rem; line-height: 1.5; color: var(--xh-footer-text); }
/* logo */
.site-footer .grid img { height: 2rem; width: auto; }

/* copyright: 3 centered lines spanning full width (override the 2fr/1fr split) */
.site-footer > div > div:last-child {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
}
.site-footer > div > div:last-child > div { width: 100%; text-align: center; }
.site-footer > div > div:last-child .font-body { font-size: 0.85rem; color: var(--xh-footer-muted); line-height: 1.7; }
.site-footer > div > div:last-child p { margin: 0; font-size: 0.85rem; }
.site-footer > div > div:last-child a { color: var(--xh-footer-muted); text-decoration: none; transition: color 0.2s ease; }
.site-footer > div > div:last-child a:hover { color: var(--xh-footer-hover); }

/* ---- Hero headline: keep on one line where it fits ----
 * Mercury caps the hero h1 at max-w-3xl (768px) with lg:text-7xl, so a 12-glyph
 * title wraps. Drop the cap and scale the type with the viewport so the whole
 * headline sits on one line on desktop; allow wrapping on small phones. */
.region-content h1.max-w-3xl {
  max-width: none;
  font-size: clamp(1.9rem, 5.6vw, 4.75rem);
  line-height: 1.15;
  white-space: nowrap;
  text-wrap: nowrap;
}
/* Mobile hierarchy: the clamp floor (1.9rem≈30px) collapsed the hero to the
 * content-section size (30px). Pin the hero larger so the page title stays the
 * biggest heading on phones; allow it to wrap. */
@media (max-width: 767.98px) {
  .region-content h1.max-w-3xl { font-size: 2.25rem; white-space: normal; text-wrap: balance; }
}

/* ---- CTA band headline: keep on one line on desktop ----
 * The level-2 conversion bands cap the h2 at max-w-3xl (768px) inside a
 * lg:max-w-3/4 container, so lg:text-7xl (72px) wraps even short titles. Drop
 * the cap and scale the type to the band so every headline — up to the 15-glyph
 * /about title — sits on one line. The clamp keeps the longest title within the
 * 75%-width band at the tightest desktop width; phones keep Mercury's wrapping. */
@media (min-width: 768px) {
  .region-content > section.cq-full h2.max-w-3xl {
    max-width: none;
    font-size: clamp(1.75rem, 4.5vw, 3rem);
    line-height: 1.15;
    white-space: nowrap;
    text-wrap: nowrap;
  }
}
/* Mobile: Mercury's native text-5xl (48px) made the CTA band title dwarf the
 * hero. Cap it to the section-heading size (30px) so the hero stays largest;
 * the full-bleed blue band keeps it prominent. */
@media (max-width: 767.98px) {
  .region-content > section.cq-full h2.max-w-3xl {
    font-size: 1.875rem;
    line-height: 1.2;
  }
}

/* ---- Footer company card: logo + company name on one row ---- */
.site-footer .grid > div.flex.flex-col > div.flex.flex-row { align-items: center; gap: 0.6rem; }
.site-footer .grid > div.flex.flex-col > div.flex.flex-row h3 { font-size: 1rem; margin: 0; line-height: 1.3; min-width: 0; }
/* the branding slot is a block box; its inline-block logo link sits on the text
 * baseline leaving a descender gap, pinning the logo above the name's centerline.
 * Center the logo inside its slot so both share one horizontal axis. */
.site-footer .grid > div.flex.flex-col > div.flex.flex-row > div:first-child { display: flex; align-items: center; }

/* ---- Hero eyebrow: authorization line above each hero title ----
 * Rendered by the cta.twig override for level-1 (hero) CTAs; sits tight above
 * the big headline inside the band. The separator is a CSS-drawn circle (not a
 * text "·", whose glyph bearing looked off-center). On desktop the line is
 * stretched full-width and split into two equal halves around the dot, so the
 * dot lands exactly on the title's center axis regardless of the two phrases'
 * unequal lengths. On phones it stays a centered, naturally wrapping line. */
.region-content .cta-eyebrow {
  margin: 0 0 -1rem;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: oklch(1 0 0 / 0.85);
  text-align: center;
}
.region-content .cta-eyebrow-dot {
  display: inline-block;
  width: 0.25em;
  height: 0.25em;
  margin: 0 0.4em;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
  opacity: 0.9;
}
@media (min-width: 768px) {
  .region-content .cta-eyebrow {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .region-content .cta-eyebrow-side { flex: 1 1 0; min-width: 0; }
  .region-content .cta-eyebrow-left { text-align: right; }
  .region-content .cta-eyebrow-right { text-align: left; }
  .region-content .cta-eyebrow-dot { flex: 0 0 auto; }
}

/* ---- Video: visible play affordance on light first frames ----
 * Mercury's play/pause button is a bare white icon bottom-right; on a white
 * opening frame it is invisible and the video looks unplayable. Give it a dark
 * circular backing, centered while paused, tucked to a corner while playing. */
figure.video-component .video-controls {
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
figure.video-component .video-controls button {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  border: 0;
  border-radius: 9999px;
  background: oklch(0.2 0.03 265 / 0.55);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(2px);
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}
figure.video-component .video-controls button:hover { background: oklch(0.2 0.03 265 / 0.75); transform: scale(1.05); }
figure.video-component .video-controls button svg { width: 2.5rem; height: 2.5rem; }
/* playing: small semi-transparent pause control in the corner */
figure.video-component:has(.video-icon-pause:not(.hidden)) .video-controls { align-items: flex-end; justify-content: flex-end; padding: 1rem; }
figure.video-component:has(.video-icon-pause:not(.hidden)) .video-controls button { width: 2.75rem; height: 2.75rem; background: oklch(0.2 0.03 265 / 0.35); opacity: 0.85; }
figure.video-component:has(.video-icon-pause:not(.hidden)) .video-controls button:hover { opacity: 1; }
figure.video-component:has(.video-icon-pause:not(.hidden)) .video-controls button svg { width: 1.5rem; height: 1.5rem; }

/* ---- Consult nav CTA: make “立即咨询” a standout gradient pill ----
 * Mercury's menu template drops custom link attributes, so target the nav anchor
 * by href. data-level="1" scopes this to the top-level nav link; the in-page CTA
 * button also points to /consult but carries no data-level, so it is untouched. */
.xh-nav a[href="/consult"][data-level="1"],
nav a[href="/consult"][data-level="1"] {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #fff;
  border-radius: 9999px;
  padding-left: 1.1rem;
  padding-right: 1.1rem;
  font-weight: 600;
  box-shadow: 0 10px 20px -12px rgba(37, 99, 235, 0.75);
}
.xh-nav a[href="/consult"][data-level="1"]:hover,
.xh-nav a[href="/consult"][data-level="1"]:focus,
nav a[href="/consult"][data-level="1"]:hover,
nav a[href="/consult"][data-level="1"]:focus {
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
  color: #fff;
  filter: brightness(1.05);
}

/* ---- Header branding: logo + company name on one centered row ----
 * The native branding block stacks logo and name as block divs; lay them out
 * side by side and size the name to sit beside the mark (Mercury's default
 * heading-responsive-4xl is far too large for a navbar). */
header a[rel="home"] {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
header a[rel="home"] > .branding { flex: 0 0 auto; display: flex; align-items: center; }
header a[rel="home"] > div:not(.branding) {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--foreground);
  white-space: nowrap;
}
@media (max-width: 480px) {
  header a[rel="home"] { gap: 0.45rem; }
  header a[rel="home"] > div:not(.branding) { font-size: 1.1rem; }
}

/* ---- Contact WeChat QR cards: square, uncropped, below the text ----
 * Mercury's card.twig wraps media in aspect-video + object-cover and renders it
 * ABOVE the text, which crops a square QR into 16:9 and puts it on top. Scope by
 * the /qr/ image path (Canvas wrappers carry no data-uuid) to restore a square,
 * contain-fit QR centered BELOW each card's title + description, like the source. */
.region-content .group.relative.flex.rounded-xl:has(img[src*="/qr/"]) {
  align-items: center;
}
.region-content .group.relative.flex.rounded-xl:has(img[src*="/qr/"]) > div:has(> img[src*="/qr/"]) {
  order: 2;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 180px;
  margin: 0.75rem auto 0;
  overflow: visible;
  border-radius: 0.5rem;
}
.region-content img[src*="/qr/"] {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.5rem;
}

/* ---- Footer 服务: AI咨询 / 安防监控 / 数据备份 on one row ----
 * The footer link lists are flex-column (each link stacked). The user wants only
 * these three on a single line, separated by "/"; the first three service links
 * stay stacked. Scope to the services menu via its unique /ai-consulting link so
 * the 产品 and 联系我们 lists are untouched. Row order comes from menu weights
 * (AI咨询=3, 安防监控=4, 数据备份=5). Make the ul a wrapping row, force the first
 * three li to full width (own line), let the trio shrink to content and share a
 * line. The trio li become flex boxes so the "/" ::before sits inline with the
 * link (the <a> is itself display:flex, which would otherwise drop below it). */
.site-footer .grid ul:has(a[href="/ai-consulting"]) {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.3rem;
}
.site-footer .grid ul:has(a[href="/ai-consulting"]) > li {
  flex: 0 0 100%;
}
.site-footer .grid ul:has(a[href="/ai-consulting"]) > li:has(> a[href="/ai-consulting"]),
.site-footer .grid ul:has(a[href="/ai-consulting"]) > li:has(> a[href="/surveillance"]),
.site-footer .grid ul:has(a[href="/ai-consulting"]) > li:has(> a[href="/data-backup"]) {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
}
.site-footer .grid ul:has(a[href="/ai-consulting"]) > li:has(> a[href="/ai-consulting"]) a,
.site-footer .grid ul:has(a[href="/ai-consulting"]) > li:has(> a[href="/surveillance"]) a,
.site-footer .grid ul:has(a[href="/ai-consulting"]) > li:has(> a[href="/data-backup"]) a {
  font-size: 0.9rem;
}
.site-footer .grid ul:has(a[href="/ai-consulting"]) > li:has(> a[href="/surveillance"])::before,
.site-footer .grid ul:has(a[href="/ai-consulting"]) > li:has(> a[href="/data-backup"])::before {
  content: "/";
  margin-right: 0.3rem;
  color: var(--xh-footer-muted);
  opacity: 0.7;
}

/* ---- Card-icon rows: top-align content so headings line up across a row ----
 * Mercury card-icon.twig hardcodes `flex h-full flex-col justify-center`, which
 * vertically centers each tile's content. In a multi-column grid every tile
 * stretches to the tallest one's height, so shorter tiles center their content
 * and their heading drops below the tallest tile's heading (e.g. /dingtalk
 * hardware row, home industry row). No prop controls this; the class combo is
 * unique to card-icon. Force top alignment so every heading starts at the same y. */
.region-content .flex.h-full.flex-col.justify-center {
  justify-content: flex-start;
}

/* ---- Pricing cards: reference-reasonable type scale ----
 * Mercury card-pricing.twig sizes the title heading-responsive-4xl (lg:text-4xl
 * = 40px desktop) and the price text-4xl lg:text-5xl (40->48px); the currency
 * unit span inherits the full price size. On desktop the card title thus matched
 * or exceeded the section heading, and the unit "元/年" was as big as the number.
 * Scope to card-pricing only (article:has(h4 data) — unique to it) and set the
 * reference proportions: title 18px, price 34px, unit 14px muted. Specificity
 * beats the responsive utilities at every width; section headings + other cards
 * are untouched. Promoted (blue) card keeps a light unit for contrast. */
.region-content article:has(h4 data) header h3 {
  font-size: 1.125rem;
  line-height: 1.3;
}
.region-content article:has(h4 data) h4 {
  font-size: 2.125rem;
}
.region-content article:has(h4 data) h4 data span:first-child {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--xh-body-soft);
}
.region-content article.bg-primary:has(h4 data) h4 data span:first-child {
  color: oklch(1 0 0 / 0.85);
}

/* ---- Pricing cards: align the feature-divider across a row ----
 * The border-t rule sits atop the features block (child 3), so its y depends on
 * the header height above it. Mercury renders the subtitle <p> even when empty;
 * an empty subtitle collapses to 0 while a one-line one fills 28px, so two cards
 * side by side get dividers ~28px apart. Reserve one subtitle line (1lh = the p's
 * own line-height) so every header is the same height and the dividers align. */
.region-content article:has(h4 data) header p {
  min-height: 1lh;
}

/* ---- /qwen-ai 连接一切: compact centered connector cards ----
 * Six native card components (centered, no media) in a 3-col grid. The general
 * card chrome above already boxes them; here we tune to the source's compact
 * proportions: 8px radius, 20px pad, title 15px/700, desc 13px. Scope = centered
 * cards WITHOUT an image, which excludes the /contact QR cards (img[src*=/qr/])
 * and every left-aligned card, so only these six connectors are affected. */
.region-content .group.relative.flex.rounded-xl.text-center:not(:has(img)) {
  border-radius: 0.5rem;
  padding: 1.25rem;
  align-items: center;
}
.region-content .group.relative.flex.rounded-xl.text-center:not(:has(img)) h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.4;
}
.region-content .group.relative.flex.rounded-xl.text-center:not(:has(img)) h3 a {
  color: inherit;
  text-decoration: none;
}
.region-content .group.relative.flex.rounded-xl.text-center:not(:has(img)) p {
  font-size: 0.8125rem;
  line-height: 1.6;
  margin: 0.25rem 0 0;
}

/* ---- /qwen-ai 三种部署模式: deployment mode cards ----
 * Three group components (heading + rich text) in a 3-col grid. A group has no
 * native card chrome (bg-none), so box it here. Scope = the group whose text
 * carries the unique .xh-fit marker (a desc paragraph + a blue 适合 line); the
 * direct-child chain matches only that group, not the grid or region. Reference:
 * 16px radius, 32/26 pad, title 18px/700, desc 14px, 适合 13px brand-blue. */
.region-content div:has(> .font-body > .xh-fit) {
  align-self: stretch;
  height: 100%;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow-xs);
  padding: 2rem 1.625rem;
  gap: 0.875rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.region-content div:has(> .font-body > .xh-fit):hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--xh-card-border-hover);
}
.region-content div:has(> .font-body > .xh-fit) > h3 {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--foreground);
}
.region-content div:has(> .font-body > .xh-fit) > .font-body > p:first-child {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--xh-body-soft);
  margin: 0;
}
.region-content .font-body .xh-fit {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0.625rem 0 0;
}
/* footnote relocated below the deployment grid */
.region-content .font-body .xh-deploy-note {
  font-size: 0.8125rem;
  color: var(--xh-body-soft);
  text-align: center;
  margin: 0;
}

/* ---- /jobs 招聘岗位: reference job cards (head + pills + h4 blocks) ----
 * Each job is one rich-text component carrying a .xh-job-card wrapper: a head
 * row (h3 title left, pill tags right, hairline divider below) then the verbatim
 * h4/ul/p description blocks. The Canvas text filter was extended with these
 * specific classes (div/span) the same way xh-fit / xh-deploy-note were added.
 * Reference proportions: 16px radius, 28/26 pad, title 20px/700 brand-blue,
 * pills 12px/600 (light-blue; 急招 light-red), block h4 14px/600, body 14px/1.9. */
.region-content .font-body .xh-job-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow-xs);
  padding: 1.75rem 1.625rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.region-content .font-body .xh-job-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--xh-card-border-hover);
}
.region-content .font-body .xh-job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.625rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.875rem;
  margin-bottom: 1rem;
}
.region-content .font-body .xh-job-head h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--primary);
  margin: 0;
}
.region-content .font-body .xh-job-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0;
}
.region-content .font-body .xh-job-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--accent);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.region-content .font-body .xh-job-tag.xh-hot {
  background: oklch(0.96 0.03 25);
  color: oklch(0.58 0.20 25);
}
.region-content .font-body .xh-job-card h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin: 1rem 0 0.5rem;
}
.region-content .font-body .xh-job-card h4:first-of-type { margin-top: 0; }
.region-content .font-body .xh-job-card ul {
  margin: 0;
  padding-inline-start: 1.25rem;
}
.region-content .font-body .xh-job-card li {
  font-size: 0.875rem;
  line-height: 1.9;
  margin-bottom: 0.125rem;
  color: var(--xh-body-soft);
}
.region-content .font-body .xh-job-card p {
  font-size: 0.875rem;
  line-height: 1.9;
  color: var(--xh-body-soft);
  margin: 0;
}

/* ---- /contact 服务覆盖范围: the single wide centered coverage card ----
 * is_text_centered=true centers it like the reference .map-placeholder, but that
 * also matches the compact connector-card chrome (15px/13px, 20px pad) meant for
 * small tiles. This card is the ONLY centered image-less card that is the sole
 * child of its grid (connectors=6/grid, benefits=4/grid), so :only-child scopes
 * it uniquely. Restore readable wide-card proportions: 16px radius, 32/26 pad,
 * title 20px, centered paragraph on a comfortable measure. */
.region-content .grid > .group.relative.flex.rounded-xl.text-center:only-child:not(:has(img)) {
  border-radius: 1rem;
  padding: 2rem 1.625rem;
}
.region-content .grid > .group.relative.flex.rounded-xl.text-center:only-child:not(:has(img)) h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
}
.region-content .grid > .group.relative.flex.rounded-xl.text-center:only-child:not(:has(img)) p {
  font-size: 0.9375rem;
  line-height: 1.8;
  max-width: 52rem;
  margin: 0.625rem auto 0;
}

/* ---- /security 携手主流安全厂商: brand pill wall (reference .brand-list) ----
 * white pills, 14/26 pad, 15px primary semibold, hairline border, hover lift;
 * flex-wrap centered across the full section width (lede constraint excluded). */
.region-content .font-body .xh-brand-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 0.5rem 0 0;
}
.region-content .font-body .xh-brand-item {
  display: inline-flex;
  align-items: center;
  padding: 0.875rem 1.625rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--xh-card-radius);
  box-shadow: var(--shadow-xs);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--primary);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.region-content .font-body .xh-brand-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--xh-card-border-hover);
}