/* ============================================================
   国元检测 - 全站公共样式（global.css）
   由模板公共部分（header 等）统一引用，请勿在每个模板里重复内联
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: #243B2E;
    line-height: 1.7;
    background: #fff;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ===== 固定头部包裹层 ===== */
.header-wrapper {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* ===== 顶部信息栏 ===== */
.top-bar {
    background: #fff;
    border-bottom: 1px solid #eef2ef;
}
.top-bar-inner {
    max-width: 1440px; margin: 0 auto;
    padding: 16px 40px;
    display: flex; justify-content: space-between; align-items: center;
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
    width: 44px; height: 44px; background: #16A34A; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 22px; font-weight: 700;
}
.logo-text h1 { font-size: 20px; color: #122B1C; font-weight: 700; letter-spacing: 1px; }
.logo-text p { font-size: 10px; color: #8AA396; letter-spacing: 0.5px; text-transform: uppercase; }

.search-box {
    display: flex; align-items: center;
    border: 2px solid #16A34A; border-radius: 30px;
    overflow: hidden; width: 460px; height: 44px;
    background: #fff;
}
.search-box input {
    flex: 1; border: none; outline: none;
    padding: 0 20px; font-size: 14px; color: #243B2E;
}
.search-box input::placeholder { color: #A3B8AB; }
.search-box button {
    width: 60px; height: 100%; border: none;
    background: #16A34A; color: #fff; font-size: 18px;
    cursor: pointer; transition: background 0.2s;
}
.search-box button:hover { background: #128A3E; }

.top-bar-right { display: flex; align-items: center; gap: 30px; }
.hotline { display: flex; align-items: center; gap: 8px; }
.hotline .icon { font-size: 22px; color: #16A34A; }
.hotline .num { font-size: 22px; font-weight: 700; color: #0B5E2E; }

/* ===== 移动端汉堡菜单按钮 ===== */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    cursor: pointer;
    margin-left: 15px;
}
.mobile-menu-btn span {
    display: block;
    height: 2px;
    background-color: #3A5245;
    border-radius: 2px;
    width: 100%;
}

/* ===== 主导航栏 ===== */
.main-nav {
    background: #0B5E2E;
    color: #fff;
    position: relative;
}
.main-nav-inner {
    max-width: 1440px; margin: 0 auto;
    display: flex; align-items: center;
    justify-content: space-between;
}

/* 左侧：检测分类按钮 */
.nav-category-wrapper {
    position: relative;
    width: 280px;
    flex-shrink: 0;
}
.nav-category-btn {
    width: 100%; background: #094D25;
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 24px; font-size: 17px; font-weight: 600;
    cursor: pointer; transition: background 0.2s;
    user-select: none;
}
.nav-category-btn:hover { background: #073D1E; }
.hamburger { font-size: 20px; }

/* 右侧：主导航链接 */
.nav-links {
    flex: 1; display: flex; justify-content: flex-end; gap: 40px;
    padding-right: 40px;
}
.nav-links > li {
    font-size: 16px; font-weight: 500; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    padding: 18px 0; transition: color 0.2s;
    position: relative;
}
.nav-links > li > a { color: inherit; }
.nav-links > li:hover { color: #7BE8A5; }
.nav-links > li.active { color: #7BE8A5; font-weight: 600; }

/* ===== 下拉箭头指示 ===== */
.nav-dropdown-wrapper { position: relative; }
.nav-dropdown-wrapper .dropdown-arrow {
    font-size: 10px;
    margin-left: 4px;
    transition: transform 0.2s;
    display: inline-block;
    color: rgba(255,255,255,0.7);
}
.nav-dropdown-wrapper:hover .dropdown-arrow {
    transform: rotate(180deg);
    color: #7BE8A5;
}

/* 下拉菜单面板 */
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 180px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.15);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    z-index: 1002;
    border: 1px solid #eef2ef;
}

        .nav-dropdown-wrapper:hover .nav-dropdown-menu {
            opacity: 1;
            visibility: visible;
            transform: translateX(-50%) translateY(0);
        }

.nav-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* 下拉菜单项 */
.nav-dropdown-menu li {
    padding: 0;
    display: block;
    width: 100%;
}
.nav-dropdown-menu li a {
    display: block;
    padding: 12px 24px;
    font-size: 14px;
    color: #3A5245;
    transition: all 0.2s;
    white-space: nowrap;
    text-align: left;
    font-weight: 400;
}
.nav-dropdown-menu li a:hover {
    background: #EAF8F0;
    color: #16A34A;
    padding-left: 28px;
}

/* 小三角指示器 */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #fff;
    border-top: 1px solid #eef2ef;
    border-left: 1px solid #eef2ef;
}

/* ===== 超级下拉菜单 (Mega Menu) ===== */
.mega-menu {
    position: absolute; top: 100%; left: 0;
    width: 1200px; height: 580px;
    background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 0 0 8px 8px;
    display: flex; overflow: hidden;
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: all 0.3s ease; z-index: 1001;
}
.nav-category-wrapper:hover .mega-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}

.mega-menu-left {
    width: 280px; flex-shrink: 0;
    background: #FAFCFA; border-right: 1px solid #eef2ef; overflow-y: auto;
}
.mega-menu-left li {
    padding: 18px 24px; display: flex; justify-content: space-between;
    align-items: center; border-bottom: 1px solid #f0f4f1;
    color: #405649; font-size: 15px; cursor: pointer; transition: all 0.2s ease;
}
.mega-menu-left li:last-child { border-bottom: none; }
.mega-menu-left li:hover, .mega-menu-left li.active {
    background: #fff; color: #16A34A; padding-left: 28px;
}
.mega-menu-left li.active { font-weight: 700; }
.mega-menu-left li .arrow { font-size: 18px; color: #C0D0C6; font-family: monospace; transition: color 0.2s; }
.mega-menu-left li:hover .arrow, .mega-menu-left li.active .arrow { color: #16A34A; }

.mega-menu-right {
    flex: 1; padding: 40px; overflow-y: auto; position: relative;
}
.category-panel { display: none; animation: fadeIn 0.4s ease forwards; }
.category-panel.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-section { margin-bottom: 32px; }
.panel-section:last-child { margin-bottom: 0; }
.panel-title {
    font-size: 16px; font-weight: 700; color: #122B1C;
    padding-bottom: 10px; margin-bottom: 20px; border-bottom: 1px solid #eef2ef;
}
.sub-items-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 20px; }
.sub-items-grid a {
    font-size: 13px; color: #4F6659; transition: color 0.2s;
    cursor: pointer; text-decoration: none; display: inline-block;
}
.sub-items-grid a:hover { color: #16A34A; text-decoration: underline; }
.sub-items-grid a.more { color: #16A34A; font-weight: 600; }

.image-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 24px; }
.image-card { cursor: pointer; transition: transform 0.2s; }
.image-card:hover { transform: translateY(-4px); }
.image-card img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; background: #eef2ef; }
.image-card p { text-align: center; font-size: 13px; color: #617A6C; margin-top: 8px; }

/* ===== 移动端侧边抽屉菜单 ===== */
.mobile-drawer-overlay {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
}
.mobile-drawer-overlay.open { opacity: 1; visibility: visible; }

.mobile-drawer {
    position: fixed; top: 0; right: -320px;
    width: 320px; height: 100vh;
    background: #fff; z-index: 2000;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    display: flex; flex-direction: column;
}
.mobile-drawer.open { right: 0; }

.mobile-drawer-header {
    display: flex; justify-content: flex-end;
    padding: 24px; border-bottom: 1px solid #eef2ef;
}
.mobile-drawer-close {
    font-size: 28px; color: #617A6C; cursor: pointer; line-height: 1;
}
.mobile-drawer-links { flex: 1; overflow-y: auto; padding: 10px 0; }

/* 一级菜单项 */
.mobile-drawer-links > li { border-bottom: 1px solid #f5f7f5; }
.mobile-drawer-links > li > a {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 24px; font-size: 16px; color: #2B4438; transition: color 0.2s;
}
.mobile-drawer-links > li.active > a {
    color: #16A34A;
    font-weight: 600;
}

/* === 移动端二级分类折叠样式 === */
.toggle-icon {
    font-size: 20px; font-weight: 300; color: #9DB3A6;
    transition: transform 0.3s ease, color 0.3s ease;
    line-height: 1;
}

.submenu {
    max-height: 0;
    overflow: hidden;
    background: #FAFCFA;
    transition: max-height 0.4s ease-in-out;
}

/* 展开状态 */
.has-submenu.open .submenu {
    max-height: 600px;
}
.has-submenu.open .toggle-icon {
    transform: rotate(45deg);
    color: #16A34A;
}
.has-submenu.open > a {
    color: #16A34A;
}

/* 二级菜单项 */
.submenu li {
    border-bottom: 1px solid #f0f4f1;
}
.submenu li:last-child {
    border-bottom: none;
}
.submenu li a {
    display: block;
    padding: 14px 24px 14px 40px;
    font-size: 14px;
    color: #617A6C;
    transition: background 0.2s, color 0.2s;
}
.submenu li a:hover {
    background: #EAF8F0;
    color: #16A34A;
}

/* ===== 头部响应式 ===== */
@media (max-width: 1400px) {
    .mega-menu { width: 1000px; }
    .sub-items-grid { grid-template-columns: repeat(3, 1fr); }
    .image-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1100px) {
    .search-box { display: none; }
    .main-nav { display: none; }
    .mobile-menu-btn { display: flex; }

    .top-bar-inner { flex-wrap: nowrap; padding: 12px 20px; justify-content: space-between; }
    .logo-text h1 { font-size: 16px; }
    .logo-text p { display: none; }
    .hotline .num { font-size: 18px; }
}
