/* ==========================================================================
   KANGYUAN — Valve Pressure Testing Machines
   Single stylesheet. No external requests (performance + SEO friendly).
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --ink: #0a1728;
  --ink-2: #10243d;
  --steel: #1d3f60;
  --accent: #f2670a;
  --accent-dark: #cf5405;
  --muted: #5a6b7d;
  --muted-2: #7b8a99;
  --line: #e2e8ef;
  --soft: #f4f7fa;
  --soft-2: #eaf0f6;
  --white: #ffffff;
  --ok: #1d7a4c;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(10, 23, 40, .06), 0 2px 8px rgba(10, 23, 40, .05);
  --shadow-md: 0 10px 30px rgba(10, 23, 40, .10);
  --container: 1180px;
  --header-h: 72px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--steel); text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.22; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(1.95rem, 1.2rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 1.05rem + 1.5vw, 2.15rem); }
h3 { font-size: clamp(1.15rem, .98rem + .6vw, 1.4rem); }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1.05em; }
ul, ol { margin: 0 0 1.05em; padding-left: 1.25em; }
li { margin-bottom: .4em; }
strong { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.section { padding: clamp(3rem, 2rem + 4vw, 5.5rem) 0; }
.section--soft { background: var(--soft); }
.section--tight { padding-top: clamp(2rem, 1.4rem + 2vw, 3rem); }
.section--dark { background: var(--ink); color: #dbe4ee; }
.section--dark h2, .section--dark h3 { color: #fff; }
.section--dark a { color: #9fd0ff; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  body { font-size: 16px; }
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--accent); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .6rem; flex: none; }
.brand img { width: 38px; height: 38px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 1.12rem; letter-spacing: .06em; color: var(--ink); }
.brand-sub { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); }

.nav { display: flex; align-items: center; gap: .35rem; }
.nav a {
  display: block; padding: .5rem .75rem; border-radius: 8px;
  font-size: .945rem; font-weight: 550; color: var(--ink-2); white-space: nowrap;
}
.nav a:hover { background: var(--soft-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--accent); }

.nav-item { position: relative; }
.nav-item > a::after {
  content: ""; display: inline-block; margin-left: .35rem; vertical-align: middle;
  border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px);
}
.dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 268px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: .45rem; display: none;
}
/* Invisible bridge across the 6px gap between the nav item and the panel.
   Without it the pointer leaves .nav-item while crossing the gap, :hover drops,
   and the panel closes before any link inside it can be clicked. The bridge is a
   child of .dropdown, so hovering it keeps .nav-item:hover true. It is widened
   horizontally so a diagonal approach from the side of the nav item works too. */
.dropdown::before {
  content: ""; position: absolute; left: -14px; right: -14px; top: -14px; height: 16px;
}
.nav-item:hover .dropdown, .nav-item:focus-within .dropdown { display: block; }
.dropdown a { padding: .55rem .7rem; font-size: .92rem; white-space: normal; }
.dropdown a span { display: block; font-size: .78rem; color: var(--muted-2); font-weight: 400; }

.header-cta { display: flex; align-items: center; gap: .6rem; flex: none; }
.nav-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: #fff;
  border-radius: 9px; cursor: pointer; padding: 0; align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; position: relative;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
@media (max-width: 1040px) {
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch;
    background: #fff; border-bottom: 1px solid var(--line); padding: .6rem 20px 1.2rem;
    box-shadow: var(--shadow-md); display: none; max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .8rem .6rem; border-bottom: 1px solid var(--soft-2); border-radius: 0; font-size: 1rem; }
  .nav-item > a::after { float: right; margin-top: .45rem; }
  .dropdown { position: static; display: block; border: 0; box-shadow: none; padding: 0 0 0 .8rem; min-width: 0; }
  /* The hover bridge only makes sense for the hovering desktop menu. Once the
     panel is static inside the mobile drawer it would just be a stray box. */
  .dropdown::before { display: none; }
  .dropdown a { border-bottom: 1px solid var(--soft-2); }
  .nav-toggle { display: flex; }
  .header-cta .btn { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .78rem 1.35rem; border-radius: 9px; font-weight: 650; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: .18s ease; text-align: center;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; transform: translateY(-1px); }
.btn-outline { border-color: var(--line); background: #fff; color: var(--ink); }
.btn-outline:hover { border-color: var(--steel); color: var(--steel); }
.btn-ghost-light { border-color: rgba(255,255,255,.4); color: #fff; background: transparent; }
.btn-ghost-light:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-lg { padding: .95rem 1.7rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #eef4fa; overflow: hidden;
  background: linear-gradient(135deg, #0a1728 0%, #123253 55%, #1b4a72 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 46px 46px; pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.08fr .92fr; gap: 3rem; align-items: center;
  padding: clamp(3rem, 2rem + 5vw, 6rem) 0;
}
.hero h1 { color: #fff; margin-bottom: 1rem; }
.hero .lead { font-size: clamp(1.03rem, .95rem + .45vw, 1.2rem); color: #c3d4e5; max-width: 42em; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.1rem;
  font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: #ffb37a;
}
.hero-eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 1.6rem; margin-top: 2.2rem; padding-top: 1.6rem; border-top: 1px solid rgba(255,255,255,.14); }
.hero-fact strong { display: block; font-size: 1.5rem; color: #fff; line-height: 1.2; }
.hero-fact span { font-size: .84rem; color: #9db4cb; }
.hero-media { position: relative; }
.hero-media img {
  border-radius: var(--radius-lg); box-shadow: 0 24px 60px rgba(0,0,0,.42); background: #0d2036;
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero-media { order: -1; }
}

/* ---------- Cards ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.6rem; box-shadow: var(--shadow-sm); transition: .2s ease; height: 100%;
}
.card:hover { border-color: #c9d6e3; box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card h3 { margin-bottom: .5rem; }
.card p:last-child { margin-bottom: 0; }
.card-media {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--soft);
  border-bottom: 1px solid var(--line); overflow: hidden;
}
.card-product { padding: 0; display: flex; flex-direction: column; }
.card-product .card-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.card-product .card-body p { color: var(--muted); font-size: .95rem; }
.card-product .card-link { margin-top: auto; font-weight: 650; font-size: .92rem; }

/* Make the ENTIRE product card clickable, not just the small "details" link.
   The existing link is stretched over the card with an absolutely positioned
   pseudo-element, so the markup stays a plain, crawlable <a href> while the whole
   tile responds to a click and shows a pointer. */
.card-product { position: relative; cursor: pointer; }
.card-product .card-link::after {
  content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius-lg);
}
.card-product:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-product .card-link:focus-visible { outline: none; }
.card-badge {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: #fff3e9; padding: .25rem .6rem; border-radius: 999px; margin-bottom: .7rem;
}

/* ---------- Feature list ---------- */
.feature { display: flex; gap: .9rem; }
.feature-icon {
  flex: none; width: 42px; height: 42px; border-radius: 10px; background: #fff3e9; color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05rem;
}
.feature h3 { font-size: 1.08rem; margin-bottom: .3rem; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }
.section--dark .feature-icon { background: rgba(242,103,10,.18); }
.section--dark .feature p { color: #a8bccf; }

/* ---------- Check list ---------- */
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { position: relative; padding-left: 1.85rem; margin-bottom: .6rem; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .48em; width: 1rem; height: .55rem;
  border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent);
  transform: rotate(-45deg);
}

/* ---------- Stats bar ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat { text-align: center; padding: 1.4rem .6rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.stat strong { display: block; font-size: 1.85rem; color: var(--steel); line-height: 1.15; }
.stat span { font-size: .85rem; color: var(--muted); }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; min-width: 520px; }
caption { text-align: left; padding: .9rem 1rem; font-weight: 650; font-size: .92rem; color: var(--muted); border-bottom: 1px solid var(--line); }
th, td { padding: .72rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--soft); font-weight: 650; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfdff; }

/* ---------- Accordion (native details/summary) ---------- */
.faq { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  cursor: pointer; padding: 1.05rem 3rem 1.05rem 1.2rem; font-weight: 650; list-style: none; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 1.2rem; top: 50%; transform: translateY(-50%);
  color: var(--accent); font-size: 1.3rem; font-weight: 700; line-height: 1;
}
.faq details[open] summary::after { content: "–"; }
.faq details[open] summary { background: var(--soft); }
.faq .faq-body { padding: 1rem 1.2rem 1.3rem; color: var(--muted); }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* ---------- Breadcrumbs ---------- */
.breadcrumb { font-size: .84rem; color: var(--muted-2); padding: 1rem 0 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; margin: 0; }
.breadcrumb li::after { content: "/"; margin-left: .45rem; color: #c3ced9; }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb a { color: var(--muted); }

/* ---------- Page hero (inner pages) ---------- */
.page-head {
  background: linear-gradient(135deg, #0a1728 0%, #14375c 100%);
  color: #dce6f0; padding-bottom: clamp(2rem, 1.5rem + 2.5vw, 3.4rem);
}
.page-head h1 { color: #fff; margin-bottom: .5rem; }
.page-head p { color: #b8cadc; max-width: 46em; margin-bottom: 0; }
.page-head a { color: #9fd0ff; }

/* ---------- Split content ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; }
.split--media-left .split-media { order: -1; }
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; gap: 1.6rem; }
  .split--media-left .split-media { order: 0; }
}

/* ---------- Contact ---------- */
.contact-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.6rem; box-shadow: var(--shadow-sm); }
.contact-item { display: flex; gap: .85rem; padding: .85rem 0; border-bottom: 1px solid var(--soft-2); }
.contact-item:last-child { border-bottom: 0; }
.contact-item .ico {
  flex: none; width: 38px; height: 38px; border-radius: 9px; background: var(--soft-2); color: var(--steel);
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
}
.contact-item b { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); font-weight: 650; }
.contact-item a, .contact-item span { font-weight: 600; word-break: break-word; }

form .field { margin-bottom: 1rem; }
form label { display: block; font-size: .86rem; font-weight: 650; margin-bottom: .35rem; }
form input, form select, form textarea {
  width: 100%; padding: .72rem .85rem; border: 1px solid var(--line); border-radius: 9px;
  font: inherit; font-size: .95rem; color: var(--ink); background: #fff;
}
form input:focus, form select:focus, form textarea:focus { outline: 2px solid #ffd0ac; border-color: var(--accent); }
form textarea { min-height: 118px; resize: vertical; }
.form-note { font-size: .82rem; color: var(--muted-2); }
.form-status { margin-top: .9rem; font-size: .9rem; font-weight: 600; color: var(--ok); }
.form-status[hidden] { display: none; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--accent) 0%, #d2530a 100%); color: #fff;
  border-radius: var(--radius-lg); padding: clamp(1.8rem, 1.2rem + 2.4vw, 3rem);
  display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: center; justify-content: space-between;
}
.cta-band h2 { color: #fff; margin-bottom: .35rem; }
.cta-band p { margin: 0; color: #ffe6d5; }
.cta-band .btn-outline { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.55); color: #fff; }
.cta-band .btn-outline:hover { background: #fff; color: var(--accent-dark); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #9fb2c6; padding: 3.2rem 0 1.4rem; font-size: .92rem; }
.site-footer h2, .site-footer h3 { color: #fff; font-size: .92rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 1rem; }
.site-footer a { color: #9fb2c6; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .5rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 2rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .brand-name { color: #fff; }
.footer-brand .brand-sub { color: #6f8296; }
.footer-bottom {
  margin-top: 2.4rem; padding-top: 1.3rem; border-top: 1px solid rgba(255,255,255,.1);
  display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; font-size: .84rem; color: #7b8fa3;
}

/* ---------- Utilities ---------- */
.eyebrow { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--accent); margin-bottom: .55rem; display: block; }
.lead { font-size: 1.08rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.6rem; }
.mt-3 { margin-top: 1.6rem; }
.mt-4 { margin-top: 2.4rem; }
.max-w { max-width: 60em; }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.5rem; }
.tag-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-list li {
  margin: 0; font-size: .84rem; background: var(--soft); border: 1px solid var(--line);
  border-radius: 999px; padding: .28rem .8rem; color: var(--muted);
}
.anchor-offset { scroll-margin-top: 90px; }

/* ---------- 404 ---------- */
.error-page { min-height: 60vh; display: flex; align-items: center; text-align: center; }
.error-code { font-size: clamp(3.5rem, 2rem + 8vw, 7rem); font-weight: 800; color: var(--soft-2); line-height: 1; }

/* ---------- Language switch (header) ---------- */
.lang-switch {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .9rem; font-weight: 650; color: var(--muted-2);
  padding: .35rem .6rem; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; white-space: nowrap;
}
.lang-switch a { color: var(--steel); padding: .05rem .15rem; }
.lang-switch a:hover { color: var(--accent); }
.lang-switch [aria-current="true"] { color: var(--ink); }
@media (max-width: 1040px) {
  .lang-switch { padding: .3rem .5rem; font-size: .85rem; }
}

/* Chinese typography: CJK glyphs are denser, so slightly looser leading reads better */
html[lang="zh-CN"] body { line-height: 1.85; letter-spacing: .01em; }
html[lang="zh-CN"] h1, html[lang="zh-CN"] h2, html[lang="zh-CN"] h3 { letter-spacing: 0; line-height: 1.35; }

/* ---------- Floating WhatsApp shortcut ---------- */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.05rem; border-radius: 999px;
  background: #25d366; color: #06331a; font-weight: 700; font-size: .92rem;
  box-shadow: 0 8px 24px rgba(10, 23, 40, .24); transition: .18s ease;
}
.wa-float:hover { background: #1fbe5b; color: #04240f; transform: translateY(-2px); }
.wa-float svg { flex: none; }
@media (max-width: 560px) {
  .wa-float { right: 12px; bottom: 12px; padding: .78rem; }
  .wa-float-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .cta-band, .hero-actions, .wa-float { display: none; }
  body { color: #000; }
}
