/* TUOHAI styles 1/4: base, layout helpers, buttons, site header, home banner and shared section frames. */

/* ---------- Reset and base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    line-height: 1.65;
    color: var(--color-text);
    background: var(--color-bg);
}
img, svg, video { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5em;
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -0.015em;
    color: var(--color-text);
}
h1 { font-size: clamp(32px, 4.6vw, 56px); font-weight: 700; }
h2 { font-size: clamp(26px, 3vw, 38px); }
h3 { font-size: clamp(20px, 2vw, 24px); }
h4 { font-size: 18px; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: 0.35em; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 600; }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: 24px; }
@media (min-width: 768px) { .container { padding-inline: 32px; } }
.section { padding-block: clamp(40px, 6.5vw, var(--spacing-lg)); }
.section--tight { padding-block: clamp(28px, 4vw, 56px); }
/* A compact page intro already closes with its own spacing, so a content section placed straight
   under it starts closer: the two paddings are not added together into one large gap. */
.section--after-intro { padding-top: clamp(12px, 1.4vw, 20px); }
.section--soft { background: var(--color-primary-light); }
.section--surface { background: var(--color-surface); }
.section-head { max-width: 760px; margin-bottom: clamp(24px, 3vw, 44px); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-title { margin-bottom: 12px; }
.section-lead { color: var(--color-text-secondary); font-size: 17px; margin: 0; }
.eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary);
}
.text-center { text-align: center; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: 16px; top: 12px; z-index: 120;
    padding: 10px 16px; border-radius: var(--radius-md);
    background: var(--color-primary); color: #fff; font-weight: 600;
    transform: translateY(-220%);
    transition: transform 0.15s ease;
}
.skip-link:focus { transform: none; text-decoration: none; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; color: var(--color-accent); }
.link-arrow::after { content: "\2192"; transition: transform 0.18s ease; }
.link-arrow:hover { text-decoration: none; }
.link-arrow:hover::after { transform: translateX(3px); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 22px;
    border: 1px solid transparent; border-radius: var(--radius-md);
    font-family: var(--font-body); font-size: 15px; font-weight: 600; line-height: 1;
    text-align: center; cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--color-primary); color: #fff; }
/* Hover reads clearly: a deeper blue plus a soft lift, so the change is visible on white and on
   tinted sections alike. Pressing the button settles it back down. */
.btn--primary:hover { background: var(--color-primary-dark); box-shadow: 0 6px 16px rgba(16, 62, 140, 0.26); transform: translateY(-1px); }
.btn--primary:active { box-shadow: none; transform: translateY(0); }
.btn--outline { border-color: var(--color-primary); color: var(--color-primary); background: transparent; }
.btn--outline:hover { background: var(--color-primary); color: #fff; }
.btn--light { background: #fff; color: var(--color-primary); }
.btn--light:hover { background: var(--color-primary-light); }
.btn--ghost-light { border-color: rgba(255, 255, 255, 0.65); color: #fff; background: transparent; }
.btn--ghost-light:hover { background: rgba(255, 255, 255, 0.14); }
.btn--sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn--block { width: 100%; }

/* ---------- Site header ---------- */
.site-header { position: sticky; top: 0; z-index: 60; background: var(--color-surface); }
.header-bar { background: var(--color-surface); border-bottom: 1px solid var(--color-border); transition: box-shadow 0.2s ease; }
.header-bar.is-scrolled { box-shadow: var(--shadow-sm); }
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; grid-column: 1; justify-self: start; }
.brand:hover { text-decoration: none; }
.brand img { display: block; height: 44px; width: auto; }
@media (max-width: 480px) { .brand img { height: 36px; } }
.main-nav { grid-column: 2; }
.nav-list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-list li { margin: 0; }
.nav-link {
    display: inline-flex; align-items: center; height: 40px; padding: 0 14px;
    border-radius: var(--radius-md);
    color: var(--color-text); font-size: 15px; font-weight: 500;
    transition: background-color 0.18s ease, color 0.18s ease;
}
.nav-link:hover { background: var(--color-primary-light); color: var(--color-primary); text-decoration: none; }
.nav-link[aria-current="page"] { background: var(--color-primary-light); color: var(--color-primary); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 12px; grid-column: 3; justify-self: end; }
.lang-switch { position: relative; }
.lang-switch summary {
    display: inline-flex; align-items: center; gap: 8px;
    height: 40px; padding: 0 12px;
    border: 1px solid var(--color-border); border-radius: var(--radius-md);
    color: var(--color-text); font-size: 14px; font-weight: 500; cursor: pointer;
    list-style: none;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover { border-color: var(--color-primary); color: var(--color-primary); }
.lang-switch summary::after {
    content: ""; width: 7px; height: 7px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}
.lang-menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 70;
    min-width: 190px; margin: 0; padding: 6px; list-style: none;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.lang-menu a { display: block; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--color-text); font-size: 14.5px; }
.lang-menu a:hover { background: var(--color-primary-light); text-decoration: none; }
.lang-menu a[aria-current="true"] { color: var(--color-primary); font-weight: 600; }
.nav-toggle {
    display: none; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border: 1px solid var(--color-border); border-radius: var(--radius-md);
    background: var(--color-surface); color: var(--color-text); cursor: pointer;
}
.nav-toggle-bars { position: relative; display: block; width: 18px; height: 2px; background: currentColor; }
.nav-toggle-bars::before, .nav-toggle-bars::after {
    content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor;
    transition: transform 0.18s ease;
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1023px) {
    /* Flex here, not grid: the mobile panel is absolutely positioned and must span the whole bar.
       Keeping the container out of grid layout also keeps the panel away from the grid-placement
       rules, so it stays a plain full-width overlay under the header at every browser. */
    .header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
    .main-nav {
        display: none;
        position: absolute; top: 100%; left: 0; right: 0; z-index: 65;
        padding: 12px 24px 20px;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-sm);
    }
    .main-nav.is-open { display: block; }
    .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
    .nav-link { height: 48px; padding: 0 12px; }
    .nav-toggle { display: inline-flex; }
}

/* ---------- Home product banner (42% copy / 58% photo) ---------- */
.hero-split { background: var(--color-primary-light); padding-block: clamp(28px, 3.5vw, 48px); }
.hero-split-grid { display: grid; gap: clamp(24px, 3vw, 48px); grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); align-items: center; }
.hero-copy { max-width: 520px; }
.hero-title { margin: 10px 0 16px; }
.hero-sub { margin: 0; color: var(--color-text-secondary); font-size: clamp(17px, 1.5vw, 20px); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-note { margin: 18px 0 0; color: var(--color-text-secondary); font-size: 14.5px; }
.hero-photo { margin: 0; overflow: hidden; border-radius: var(--radius-lg); background: var(--color-surface); }
.hero-photo img { width: 100%; aspect-ratio: 16 / 10; max-height: 520px; object-fit: cover; }
@media (max-width: 900px) {
    .hero-split-grid { grid-template-columns: 1fr; gap: 22px; }
    .hero-copy { max-width: none; }
    .hero-photo img { aspect-ratio: 4 / 3; max-height: none; }
}

/* ---------- Home product series carousel ---------- */
.section-head--row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; max-width: none; }
.section-head--row > div { max-width: 680px; }
.rail-controls { display: flex; align-items: center; gap: 10px; }
.rail-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border: 1px solid var(--color-border); border-radius: var(--radius-md);
    background: var(--color-surface); color: var(--color-text);
    font-size: 18px; line-height: 1; cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease;
}
.rail-btn:hover:not(:disabled) { border-color: var(--color-primary); color: var(--color-primary); }
.rail-btn:disabled { opacity: 0.45; cursor: default; }
.rail-pos { min-width: 52px; text-align: center; color: var(--color-text-secondary); font-size: 14px; font-variant-numeric: tabular-nums; }
.series-rail {
    display: flex; gap: 24px; margin: 0; padding: 0 0 6px; list-style: none;
    overflow-x: hidden;
}
.series-slide { flex: 0 0 calc((100% - 48px) / 3); margin: 0; }
.series-link { display: flex; flex-direction: column; gap: 12px; height: 100%; color: inherit; }
.series-link:hover { text-decoration: none; }
.series-figure { margin: 0; overflow: hidden; border-radius: var(--radius-lg); background: var(--color-primary-light); }
.series-figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.25s ease; }
.series-link:hover .series-figure img { transform: scale(1.03); }
.series-name { margin: 0; font-size: 21px; transition: color 0.18s ease; }
.series-link:hover .series-name { color: var(--color-primary); }
.series-use { margin: 0; color: var(--color-text-secondary); font-size: 15px; }
.series-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; color: var(--color-primary); font-size: 15px; font-weight: 600; }
.series-cta::after { content: "\2192"; transition: transform 0.18s ease; }
.series-link:hover .series-cta::after { transform: translateX(3px); }
@media (max-width: 1024px) and (min-width: 641px) { .series-slide { flex-basis: calc((100% - 24px) / 2); } }
@media (max-width: 640px) {
    .series-rail { gap: 16px; }
    .series-slide { flex-basis: 86%; }
}

/* ---------- Split (photo + text) ---------- */
.split { display: grid; gap: clamp(24px, 4vw, 56px); grid-template-columns: 1.05fr 1fr; align-items: center; }
.split--reverse { grid-template-columns: 1fr 1.05fr; }
.split--reverse .split-media { order: 2; }
.split-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); }
.split-body p { color: var(--color-text-secondary); }
.steps-list { display: grid; gap: 14px; margin: 22px 0 26px; padding: 0; list-style: none; }
.steps-list li { display: flex; gap: 12px; margin: 0; }
.step-num {
    flex: none; width: 28px; height: 28px; margin-top: 2px;
    display: grid; place-items: center;
    border-radius: 50%; background: var(--color-primary-light); color: var(--color-primary);
    font-size: 14px; font-weight: 600;
}
.step-body { color: var(--color-text-secondary); font-size: 15.5px; }
.step-body strong { color: var(--color-text); }

/* ---------- Capabilities (non-equal grid) ---------- */
.cap-grid { display: grid; gap: 20px; grid-template-columns: repeat(12, 1fr); }
.cap-item {
    grid-column: span 5;
    padding: 28px;
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
}
.cap-item--wide { grid-column: span 7; }
.cap-title { margin: 0 0 8px; font-size: 19px; }
.cap-text { margin: 0; color: var(--color-text-secondary); font-size: 15.5px; }

/* ---------- Certificate gallery ---------- */
/* Every entry is a document that has to stay readable, so no fixed frame crops it and none is
   forced into empty space: each picture keeps its own shape at the full column width and the
   pictures pack into columns, which also keeps a mix of portrait and landscape files tidy. */
.cert-gallery { columns: 4; column-gap: 20px; }
.cert-figure { margin: 0 0 20px; break-inside: avoid; }
.cert-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.cert-open img { display: block; width: 100%; height: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); transition: border-color 0.18s ease; }
.cert-open:hover img { border-color: var(--color-primary); }
.cert-open:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-md); }
@media (max-width: 880px) { .cert-gallery { columns: 2; } }
@media (max-width: 480px) { .cert-gallery { columns: 1; } }
