/* =========================================================
   RIEBO 全局导航 + 睿检子导航
   与主站 rainpoo 主题头部保持一致，样式作用域独立，避免影响页面内容
   ========================================================= */
:root {
    --blue: #00429a;
    --ink: #071427;
    --muted: #66758a;
    --line: #dfe5ec;
    --soft: #f3f6f9;
    --global-header: 76px;
    --subnav-height: 52px;
}

body.menu-open { overflow: hidden; }
[id] { scroll-margin-top: calc(var(--subnav-height) + 16px); }

/* ---------- 顶层 RIEBO 导航 ---------- */
.page-progress {
    position: fixed; z-index: 9999; top: 0; left: 0; width: 0; height: 2px;
    background: #64a8ff; box-shadow: 0 0 16px rgba(100, 168, 255, .8);
}
.site-header {
    position: relative; z-index: 1000; top: 0; left: 0; width: 100%;
    height: var(--global-header); color: var(--ink); background: #fff;
    transition: box-shadow .35s, height .35s;
}
.site-header.scrolled, .site-header.mega-open {
    height: var(--global-header); background: #fff; color: var(--ink);
    box-shadow: 0 1px 0 rgba(7, 20, 39, .08), 0 16px 50px rgba(7, 20, 39, .07);
}
.header-inner {
    height: 100%; width: min(1500px, calc(100% - 48px)); margin: auto;
    display: grid; grid-template-columns: 168px 1fr auto; align-items: center; gap: 34px;
}
.brand { position: relative; width: 132px; height: 30px; display: block; }
.brand img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: contain; object-position: left center; transition: opacity .3s;
}
.brand-blue { opacity: 0; }
.site-header.scrolled .brand-white, .site-header.mega-open .brand-white { opacity: 0; }
.site-header.scrolled .brand-blue, .site-header.mega-open .brand-blue { opacity: 1; }

.desktop-nav { justify-self: center; display: flex; align-items: center; height: 100%; gap: 34px; }
.nav-item { display: flex; align-items: center; height: 100%; position: relative; }
.site-header .nav-link {
    font-size: 14px; letter-spacing: .02em; font-weight: 600;
    position: relative; padding: 31px 0; white-space: nowrap; color: inherit;
}
.nav-link:after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 19px; height: 1.5px;
    background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .3s;
}
.nav-link:hover:after, .nav-link.active:after { transform: scaleX(1); transform-origin: left; }
.nav-item:hover .nav-link, .nav-item.open .nav-link,
.nav-item:hover .nav-caret, .nav-item.open .nav-caret { color: var(--blue); }

.nav-caret {
    border: 0; background: none; width: 17px; height: 17px; cursor: pointer;
    position: relative; padding: 0; margin-left: 5px; border-radius: 50%; transition: background .25s;
}
.nav-caret:hover { background: #edf4fc; }
.nav-caret:before, .nav-caret:after {
    content: ""; position: absolute; top: 8px; width: 5px; height: 1px;
    background: currentColor; transition: transform .3s;
}
.nav-caret:before { left: 4px; transform: rotate(40deg); }
.nav-caret:after { right: 4px; transform: rotate(-40deg); }
.nav-item.open .nav-caret:before { transform: rotate(-40deg); }
.nav-item.open .nav-caret:after { transform: rotate(40deg); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.lang-link {
    font-size: 12px; white-space: nowrap; font-weight: 600;
    display: inline-flex; align-items: center; gap: 5px; letter-spacing: .1em; color: var(--ink);
}
.lang-link:before {
    content: ""; width: 12px; height: 12px; border: 1px solid currentColor; border-radius: 50%;
    background: linear-gradient(90deg, transparent 43%, currentColor 44%, currentColor 56%, transparent 57%),
    linear-gradient(0deg, transparent 43%, currentColor 44%, currentColor 56%, transparent 57%);
    opacity: .75;
}
.site-header .quote-btn {
    display: flex; align-items: center; gap: 24px; font-weight: 600;
    padding: 12px 17px; border: 1px solid var(--blue); border-radius: 8px;
    font-size: 13px; transition: .3s; position: relative; overflow: hidden;
    background: var(--blue); color: #fff; white-space: nowrap;
}
.site-header .quote-btn:hover { background: #073d82; color: #fff; transform: translateY(-2px); }
.search-trigger {
    position: relative; width: 38px; height: 38px; padding: 0; border: 0; background: transparent;
    color: inherit; cursor: pointer; border-radius: 50%; transition: background .25s, transform .25s;
}
.search-trigger:hover { background: #edf4fc; transform: translateY(-1px); }
.search-trigger:before {
    content: ""; position: absolute; width: 13px; height: 13px; border: 1.5px solid currentColor;
    border-radius: 50%; left: 10px; top: 9px;
}
.search-trigger:after {
    content: ""; position: absolute; width: 8px; height: 1.5px; background: currentColor;
    transform: rotate(45deg); left: 22px; top: 23px; transform-origin: left center;
}
.site-header .menu-toggle { display: none; background: none; border: 0; width: 38px; height: 38px; position: relative; color: inherit; }
.site-header .menu-toggle i { position: absolute; left: 7px; width: 24px; height: 1.5px; background: currentColor; }
.site-header .menu-toggle i:first-child { top: 14px; }
.site-header .menu-toggle i:last-child { top: 22px; }

.mega-backdrop {
    position: fixed; inset: var(--global-header) 0 0; background: rgba(1, 13, 31, .56);
    opacity: 0; visibility: hidden; transition: .3s; pointer-events: none; backdrop-filter: blur(3px);
}
.site-header.mega-open .mega-backdrop { opacity: 1; visibility: visible; }
.site-header.compact-open .mega-backdrop { opacity: 0; visibility: hidden; }

.mega-tab-panel { display: none; animation: megaPanelIn .35s ease both; }
.mega-tab-panel.active { display: block; }
@keyframes megaPanelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.riebo-header .riebo-product-menu {
    width: 100%; max-width: none; padding: 0; background: #fff; border-radius: 0; overflow: hidden;
    position: absolute; top: 100%; left: 50%; transform: translate(-50%, -14px);
    border-top: 1px solid #e5eaf0; box-shadow: 0 24px 54px rgba(3, 22, 48, .12);
    opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s, transform .35s;
}
.riebo-header .riebo-product-menu.show {
    opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0);
}
.riebo-product-menu-inner {
    width: min(1440px, calc(100vw - 72px)); min-height: 350px; margin: 0 auto;
    display: grid; grid-template-columns: 170px minmax(0, 1fr); background: #fff;
}
.riebo-product-menu-tabs {
    padding: 42px 30px 34px 0; border-right: 1px solid #e3e8ee;
    display: flex; flex-direction: column; gap: 4px;
}
.riebo-product-menu-tabs button {
    position: relative; border: 0; background: transparent; text-align: left;
    padding: 15px 25px 15px 4px; color: #202b39; font-size: 14px; font-weight: 500;
    cursor: pointer; transition: color .22s, padding-left .22s;
}
.riebo-product-menu-tabs button:after {
    content: ""; position: absolute; right: 3px; top: 50%; width: 7px; height: 7px;
    border-top: 1px solid currentColor; border-right: 1px solid currentColor;
    transform: translateY(-50%) rotate(45deg); opacity: 0; transition: .22s;
}
.riebo-product-menu-tabs button:hover, .riebo-product-menu-tabs button.active { color: #00429a; padding-left: 10px; }
.riebo-product-menu-tabs button:hover:after, .riebo-product-menu-tabs button.active:after { opacity: 1; right: 7px; }
.riebo-product-menu-content { min-width: 0; padding: 31px 0 30px 40px; }
.riebo-product-panel.no-feature { display: block; min-height: 288px; }
.riebo-product-panel.no-feature .riebo-series-grid { width: 100%; }
.riebo-inspection-links .riebo-series-column a { justify-content: flex-start; gap: 50px; }
.riebo-inspection-links .riebo-series-column a span { min-width: 140px; }
.riebo-inspection-links .riebo-series-column a div { display: flex; justify-content: space-between; flex: 1; }
.riebo-series-column a i { font-style: normal; color: #00429a; opacity: 0; transform: translateX(-5px); transition: .2s; }
.riebo-series-column a:hover i { opacity: 1; transform: translateX(0); }
.riebo-series-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 50px; padding-top: 4px; min-width: 0;
}
.riebo-series-column { min-width: 0; }
.riebo-series-column h4 { margin: 0 0 18px; font-size: 14px; font-weight: 500; color: #111d2c; white-space: nowrap; }
.riebo-series-column a {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 40px; border-bottom: 1px solid #edf0f4; font-size: 12px; color: #667386;
    transition: color .2s, padding-left .2s;
}
.riebo-series-column a:hover { color: #00429a; padding-left: 5px; }

.riebo-header .riebo-solution-menu {
    left: 50%; width: 100%; max-width: none; padding: 0;
    background: #fff; border: 0; border-top: 1px solid #e5eaf0; border-radius: 0;
    box-shadow: 0 24px 54px rgba(3, 22, 48, .12); overflow: hidden;
    position: absolute; top: 100%; transform: translate(-50%, -12px);
    opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s, transform .35s;
}
.riebo-header .riebo-solution-menu.show {
    transform: translate(-50%, 0); opacity: 1; visibility: visible; pointer-events: auto;
}
.riebo-solution-menu-inner {
    width: min(1440px, calc(100vw - 72px)); min-height: 390px; margin: 0 auto;
    display: grid; grid-template-columns: 170px minmax(0, 1fr); background: #fff;
}
.riebo-solution-menu-tabs {
    padding: 42px 30px 34px 0; border-right: 1px solid #e3e8ee;
    display: flex; flex-direction: column; gap: 4px;
}
.riebo-solution-menu-tabs button {
    position: relative; border: 0; background: transparent; text-align: left;
    padding: 15px 25px 15px 4px; color: #202b39; font-size: 14px; font-weight: 500;
    cursor: pointer; transition: color .22s, padding-left .22s;
}
.riebo-solution-menu-tabs button:after {
    content: ""; position: absolute; right: 3px; top: 50%; width: 7px; height: 7px;
    border-top: 1px solid currentColor; border-right: 1px solid currentColor;
    transform: translateY(-50%) rotate(45deg); opacity: 0; transition: .22s;
}
.riebo-solution-menu-tabs button:hover, .riebo-solution-menu-tabs button.active { color: #00429a; padding-left: 10px; }
.riebo-solution-menu-tabs button:hover:after, .riebo-solution-menu-tabs button.active:after { opacity: 1; right: 7px; }
.riebo-solution-menu-content { min-width: 0; padding: 32px 0 32px 40px; }
.riebo-solution-links {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 52px; max-width: 1050px;
}
.riebo-solution-links a {
    position: relative; min-height: 62px; display: flex; align-items: center;
    justify-content: space-between; gap: 18px; padding: 10px 8px 10px 0;
    border-bottom: 1px solid #edf0f4; color: #29384a;
    transition: color .22s, padding-left .22s, background .22s;
}
.riebo-solution-links a b { font-size: 13px; line-height: 1.6; font-weight: 650; }
.riebo-solution-links a i { flex: 0 0 auto; font-style: normal; color: #00429a; opacity: 0; transform: translateX(-5px); transition: .22s; }
.riebo-solution-links a:hover { color: #00429a; padding-left: 9px; background: #f7f9fc; }
.riebo-solution-links a:hover i { opacity: 1; transform: none; }

.riebo-header .nav-popover {
    position: absolute; top: 100%; left: 0; width: 176px; max-width: none;
    display: block; padding: 8px; border: 1px solid rgba(15, 34, 57, .1); border-top: 0;
    border-radius: 0 0 10px 10px; background: #fff; color: #111d2c;
    box-shadow: 0 18px 48px rgba(6, 24, 47, .16); opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(-9px);
    transition: opacity .18s ease, visibility .18s ease, transform .25s cubic-bezier(.22, .8, .25, 1);
    overflow: visible;
}
.riebo-header .nav-popover.show { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.nav-popover-links { display: flex; flex-direction: column; gap: 2px; }
.nav-popover-links a {
    position: relative; display: flex; align-items: center; min-height: 42px;
    padding: 0 15px; border-radius: 6px; font-size: 13px; font-weight: 600;
    color: #192536; white-space: nowrap; transition: color .2s, background .2s, padding-left .2s;
}
.nav-popover-links a:after {
    content: "→"; position: absolute; right: 14px; color: #00429a;
    opacity: 0; transform: translateX(-5px); transition: .2s;
}
.nav-popover-links a:hover { color: #00429a; background: #f1f6fc; padding-left: 19px; }
.nav-popover-links a:hover:after { opacity: 1; transform: none; }

/* ---------- 移动端抽屉 ---------- */
.mobile-drawer {
    position: fixed; z-index: 2000; inset: 0; background: #061a36; color: #fff;
    padding: 26px; transform: translateX(100%);
    transition: transform .45s cubic-bezier(.2, .8, .2, 1); overflow: auto;
}
.mobile-drawer.open { transform: none; }
.mobile-drawer:not(.is-open) { visibility: hidden; }
.mobile-top { display: flex; align-items: center; justify-content: space-between; }
.mobile-top img { width: 116px; }
.mobile-close {
    background: none; border: 1px solid rgba(255, 255, 255, .3); color: #fff;
    border-radius: 50%; width: 40px; height: 40px; font-size: 25px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.mobile-links { margin-top: 50px; border-top: 1px solid rgba(255, 255, 255, .16); }
.mobile-links > a, .mobile-links summary {
    display: block; padding: 18px 2px; border-bottom: 1px solid rgba(255, 255, 255, .16);
    font-size: 20px; font-weight: 700;
}
.mobile-links details > a { display: block; color: #aec8ea; padding: 10px 20px; font-size: 14px; }
.mobile-links summary { list-style: none; position: relative; cursor: pointer; }
.mobile-links summary:after { content: "+"; position: absolute; right: 5px; }
.mobile-links details[open] summary:after { content: "−"; }
.mobile-quote {
    display: block; background: #fff; color: var(--blue); padding: 16px;
    text-align: center; border-radius: 999px; font-weight: 800; margin: 34px 0;
}
.mobile-group-label {
    display: block; padding: 16px 17px 5px; color: #fff; font-size: 12px;
    font-weight: 800; letter-spacing: .08em;
}

/* ---------- 全站搜索面板 ---------- */
.site-search {
    position: fixed; z-index: 2500; inset: 0;
    background: rgba(2, 14, 32, .72); backdrop-filter: blur(10px);
    opacity: 0; visibility: hidden; transition: .3s; padding: 90px 24px 24px;
}
.site-search.open { opacity: 1; visibility: visible; }
.search-panel {
    width: min(980px, 100%); margin: auto; background: #fff; border-radius: 20px;
    padding: 28px 32px 34px; box-shadow: 0 40px 120px rgba(1, 12, 28, .3);
    transform: translateY(-14px); transition: transform .38s cubic-bezier(.2, .8, .2, 1);
}
.site-search.open .search-panel { transform: none; }
.search-top {
    display: flex; justify-content: space-between; align-items: center;
    color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .18em;
}
.search-close {
    width: 36px; height: 36px; border: 1px solid #e0e7ef; background: #fff; border-radius: 50%;
    font-size: 22px; line-height: 1; cursor: pointer; color: #657589; transition: .25s;
}
.search-close:hover { background: var(--blue); color: #fff; border-color: var(--blue); transform: rotate(90deg); }
.search-field { position: relative; display: block; margin-top: 28px; border-bottom: 2px solid #12253c; }
.search-field input {
    width: 100%; border: 0; outline: 0; padding: 10px 52px 15px 0;
    font-size: 32px; line-height: 1.2; color: var(--ink);
    background: transparent; letter-spacing: -.025em;
}
.search-field input::placeholder { color: #a8b3c0; }
.search-field i { position: absolute; right: 4px; top: 11px; width: 22px; height: 22px; border: 1.8px solid var(--blue); border-radius: 50%; }
.search-field i:after {
    content: ""; position: absolute; width: 11px; height: 1.8px; background: var(--blue);
    right: -7px; bottom: -3px; transform: rotate(45deg);
}
.search-suggestions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.search-suggestions > span { font-size: 11px; color: #8795a7; margin-right: 8px; }
.search-suggestions a { font-size: 11px; padding: 8px 12px; border: 1px solid #dfe6ee; border-radius: 999px; transition: .25s; }
.search-suggestions a:hover { background: var(--blue); border-color: var(--blue); color: #fff; transform: translateY(-2px); }
.search-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 20px; }
.search-result {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 14px; border-radius: 9px; background: #f5f8fb; font-size: 12px; transition: .25s;
}
.search-result:hover { background: #eaf2fb; color: var(--blue); transform: translateX(3px); }
.search-empty { font-size: 12px; color: #8997a8; padding: 14px 0; }

/* ---------- 睿检子导航 ---------- */
#navbar.riebo-subnav {
    position: sticky; top: 0; left: 0; width: 100%;
    height: var(--subnav-height); padding: 0; z-index: 900;
    background: #fff; border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 12px rgba(7, 20, 39, .06);
}
#navbar.riebo-subnav.scrolled { background: #fff; box-shadow: 0 4px 14px rgba(7, 20, 39, .08); }
#navbar .subnav-inner { height: 100%; gap: 24px; }
#navbar .subnav-brand {
    align-self: stretch; display: flex; flex-direction: column;justify-content: center;
    margin-left: -20px; padding: 0 20px;text-align: right;
    background: #fff; color: #00429a; white-space: nowrap;
}
#navbar .riejian-logo {
    display: block; width: 134px; height: 21px; background-color: #00429a;
    -webkit-mask-image: url("../images/riejian-white.webp");
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: left center;
    -webkit-mask-size: contain;
    mask-image: url("../images/riejian-white.webp");
    mask-repeat: no-repeat;
    mask-position: left center;
    mask-size: contain;
}
#navbar .subnav-brand-sub {
    margin-top: 3px; font-size: 7px; font-weight: 600;
    letter-spacing: .16em; line-height: 1; color: #00429a;
}
#navbar .subnav-brand:hover .riejian-logo { background-color: #073d82; }
#navbar .subnav-brand:hover .subnav-brand-sub { color: #073d82; }
#navbar .nav-menu { gap: 4px; }
#navbar .nav-menu > a, #navbar .nav-menu .dropdown-toggle {
    position: relative; color: #334155; font-size: 13px; font-weight: 600;
    padding: 8px 12px; white-space: nowrap;
}
#navbar .nav-menu > a:hover, #navbar .nav-menu .dropdown-toggle:hover,
#navbar .nav-menu > a.active, #navbar .nav-menu .dropdown-toggle.active { color: var(--blue); }
#navbar .nav-menu > a.active:after, #navbar .nav-menu > a:hover:after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--blue);
}
#navbar .nav-menu .dropdown-toggle i { font-size: 10px; }
#navbar .subnav-inner { justify-content: flex-end; }
#navbar .subnav-brand { margin-right: auto; }
#navbar .subnav-quote {
    display: none; align-items: center; justify-content: center;
    padding: 9px 16px; border-radius: 6px;
    background: #00429a; color: #fff; font-size: 12px; font-weight: 600;
    letter-spacing: .02em; line-height: 1.2; white-space: nowrap;
    opacity: 0; visibility: hidden; transform: translateY(-6px); pointer-events: none;
    transition: opacity .25s ease, visibility .25s ease, transform .25s ease,
                background .25s, box-shadow .25s;
}
#navbar.scrolled .subnav-quote {
    display: inline-flex;opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}
#navbar.scrolled .subnav-quote:hover {
    background: #073d82; color: #fff; transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 66, 154, .24);
}
#navbar .subnav-quote-mobile {
    display: block; margin-top: 12px; padding: 12px 16px;
    background: #00429a; color: #fff; text-align: center;
    border-radius: 6px; font-weight: 600;
}
#navbar .subnav-quote-mobile:hover { background: #073d82; color: #fff; }
#navbar .dropdown-menu { margin-top: 0; top: 100%; }
#navbar .subnav-toggle { display: none; }
#navbar .mobile-menu {
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    width: min(680px, calc(100% - 24px)); margin-top: 6px;
    max-height: calc(100vh - var(--global-header) - var(--subnav-height) - 24px);
    overflow: auto; z-index: 10;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1300px) {
    .riebo-product-menu-inner { width: calc(100vw - 48px); grid-template-columns: 150px minmax(0, 1fr); }
    .riebo-product-menu-content { padding-left: 28px; }
    .riebo-series-grid { gap: 18px; }
    .riebo-solution-menu-inner { width: calc(100vw - 48px); grid-template-columns: 150px minmax(0, 1fr); }
    .riebo-solution-menu-content { padding-left: 28px; }
    .riebo-solution-links { gap: 0 32px; }
}
@media (max-width: 1240px) {
    .desktop-nav { gap: 22px; }
    .header-inner { grid-template-columns: 150px 1fr auto; gap: 20px; }
}
@media (max-width: 1100px) {
    .desktop-nav { display: none; }
    .site-header .menu-toggle { display: block; }
    .header-inner { grid-template-columns: 1fr auto; width: calc(100% - 36px); }
    .header-actions { grid-column: 2; }
    .lang-link, .site-header .quote-btn { display: none; }
    .riebo-header .riebo-product-menu, .riebo-header .riebo-solution-menu,
    .riebo-header .nav-popover, .mega-backdrop { display: none; }
    .site-search { padding-top: 72px; }
    #navbar .nav-menu, #navbar .subnav-quote { display: none; }
    #navbar .subnav-toggle {
        display: block; background: none; border: 0; color: var(--blue);
        font-size: 20px; cursor: pointer; line-height: 1;
    }
}
@media (max-width: 760px) {
    :root { --global-header: 70px; --subnav-height: 48px; }
    .header-inner { width: calc(100% - 28px); }
    .brand { width: 100px; }
    .search-trigger { width: 34px; height: 34px; }
    .search-trigger:before { left: 8px; top: 7px; }
    .search-trigger:after { left: 20px; top: 21px; }
    .search-panel { padding: 22px 20px 26px; border-radius: 16px; }
    .search-field input { font-size: 22px; }
    .search-results { grid-template-columns: 1fr; }
    .mobile-drawer { background: linear-gradient(155deg, #061a36, #003b89); padding: 22px; }
    .mobile-links { margin-top: 38px; }
    .mobile-links > a, .mobile-links summary { font-size: 18px; padding: 16px 2px; }
    .mobile-links details > a { padding: 9px 17px; color: #c8dbf2; }
    #navbar .subnav-brand { padding: 0 16px; }
    #navbar .riejian-logo { width: 108px; height: 17px; }
    #navbar .subnav-brand-sub { font-size: 6px; letter-spacing: .12em; }
}

@media (prefers-reduced-motion: reduce) {
    *, *:before, *:after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
