/* =====================================================================
   在商言法 · nav_redesign_v2 导航样式
   严格对标 WorkBuddy 规范 nav_redesign_v2 设计方案
   ===================================================================== */

/* ── 变量 ─────────────────────────────────────────────────── */
:root {
    --brand: #1d4f91;
    --brand-dark: #153a6e;
    --accent: #c8a35a;
    --accent-dark: #a8883e;
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg-soft: #f5f8fc;
    --warn: #dc2626;
    --ok: #16a34a;
    --white: #fff;
    --transition: .25s cubic-bezier(.4, 0, .2, 1);
    --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
    --shadow-md: 0 6px 20px rgba(0,0,0,.08);
    --shadow-lg: 0 12px 36px rgba(0,0,0,.12);
    --container-w: 1280px;
}

/* ── ⓪ 重置 & 基础 ──────────────────────────────────────── */
.wh-nav-v2 .wh-menu,
.wh-nav-v2 .wh-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wh-container {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 18px;
}

/* ── ① 顶部统计条 ────────────────────────────────────────── */
.wh-topbar {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    color: var(--ink);
    position: relative;
    z-index: 1001;
}

.wh-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    flex-wrap: wrap;
    gap: 8px;
}

.wh-topbar-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.wh-topbar-pill {
    background: var(--bg-soft);
    color: var(--brand);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.wh-topbar-label {
    color: var(--ink);
    font-size: 13px;
    margin-right: 10px;
}

.wh-topbar-contact {
    margin-left: auto;
}

.wh-topbar-hotline {
    color: var(--muted);
    font-size: 12px;
}

.wh-topbar-hotline b {
    color: var(--brand);
    font-size: 14px;
}

/* ── ② 导航包裹器（Sticky） ──────────────────────────────── */
.wh-navwrap {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow var(--transition);
}

.wh-navwrap.is-sticky {
    box-shadow: var(--shadow-sm);
}

/* Sticky 后隐藏统计条 */
.wh-navwrap.is-sticky ~ .wh-topbar,
.wh-body.is-scrolled .wh-topbar {
    display: none;
}

/* ── ③-a Logo 区 ─────────────────────────────────────────── */
.wh-logo-area {
    border-bottom: 1px solid var(--line);
}

.wh-logo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    padding-bottom: 14px;
    gap: 18px;
}

.wh-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.wh-logo-mark {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
}

.wh-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.wh-logo-text b {
    font-size: 15px;
    color: var(--brand);
    font-weight: 700;
}

.wh-logo-text small {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

/* Logo 区右侧操作 */
.wh-logo-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* 内联搜索 */
.wh-inline-search {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
    background: var(--white);
}

.wh-inline-search input {
    border: 0;
    padding: 7px 12px;
    width: 180px;
    outline: none;
    font-size: 13px;
    color: var(--ink);
    background: transparent;
}

.wh-inline-search input::placeholder {
    color: var(--muted);
}

.wh-inline-search input:focus {
    box-shadow: inset 0 0 0 1px var(--brand);
}

/* 按钮系统 */
.wh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
}

.wh-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.wh-btn-primary {
    background: var(--brand);
    color: var(--white);
    border-color: var(--brand);
}

.wh-btn-primary:hover {
    background: var(--brand-dark);
    color: var(--white);
}

.wh-btn-outline {
    background: var(--white);
    color: var(--ink);
}

.wh-btn-accent {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
    font-weight: 600;
}

.wh-btn-accent:hover {
    background: var(--accent-dark);
    color: var(--white);
}

.wh-btn-full {
    width: 100%;
}

/* 汉堡菜单（默认隐藏） */
.wh-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    margin: 3px 0;
    transition: all var(--transition);
    border-radius: 2px;
}

.wh-menu-toggle.is-active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.wh-menu-toggle.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.wh-menu-toggle.is-active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ── ③-b 主导航行 ────────────────────────────────────────── */
.wh-main-nav {
    border-bottom: 1px solid var(--line);
}

.wh-main-nav-inner {
    display: flex;
    align-items: center;
    padding: 0;
}

.wh-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* 一级菜单 */
.wh-menu-v2 {
    display: flex;
    align-items: center;
    gap: 0;
}

.wh-menu-v2 > li {
    position: relative;
}

.wh-menu-v2 > li > a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all .15s ease;
    white-space: nowrap;
    position: relative;
}

.wh-menu-v2 > li > a:hover,
.wh-menu-v2 > li:hover > a,
.wh-menu-v2 > li.active > a {
    color: var(--brand);
    border-bottom-color: var(--brand);
    background: var(--bg-soft);
}

/* HOT 标签 */
.nav-badge {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
}

.nav-badge-hot {
    background: var(--accent);
    color: var(--white);
}

/* CTA 菜单项（在线咨询） */
.menu-item-cta > a {
    color: var(--accent) !important;
    font-weight: 700;
}

.menu-item-cta > a:hover {
    color: var(--accent-dark) !important;
    border-bottom-color: var(--accent) !important;
}

/* ── ③-c 热门子栏 ────────────────────────────────────────── */
.wh-subbar {
    background: var(--bg-soft);
    border-top: 1px solid var(--line);
}

.wh-subbar-inner {
    display: flex;
    align-items: center;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 12px;
    color: var(--muted);
    gap: 14px;
    flex-wrap: wrap;
}

.wh-subbar-label {
    color: var(--brand);
    font-weight: 600;
    margin-right: 4px;
}

.wh-subbar-inner a {
    color: var(--muted);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all .15s ease;
}

.wh-subbar-inner a:hover {
    color: var(--brand);
    background: rgba(29, 79, 145, .06);
}

.wh-subbar-tel {
    margin-left: auto;
    color: var(--brand) !important;
    font-weight: 500;
}

/* ── ④ 普通下拉菜单 ──────────────────────────────────────── */
.sub-menu-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    min-width: 220px;
    background: var(--white);
    border: 1px solid var(--line);
    border-top: 3px solid var(--brand);
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow-md);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: 110;
}

.menu-item-has-children:hover > .sub-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.sub-menu-dropdown li {
    list-style: none;
}

.sub-menu-dropdown li a {
    display: flex;
    flex-direction: column;
    padding: 10px 20px;
    color: var(--ink);
    text-decoration: none;
    transition: all .12s ease;
}

.sub-menu-dropdown li a:hover {
    background: var(--bg-soft);
    padding-left: 24px;
}

.dropdown-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
}

.dropdown-desc {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

/* ── ⑤ Mega Menu 网格面板 ────────────────────────────────── */
.menu-item-mega {
    position: static;
}

.sub-menu-mega {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--line);
    border-top: 3px solid var(--brand);
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow-lg);
    padding: 24px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: all var(--transition);
    z-index: 110;
}

.menu-item-mega:hover > .sub-menu-mega {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 32px;
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 40px;
}

.mega-item {
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    background: var(--bg-soft);
    border-radius: 8px;
    text-decoration: none;
    transition: all .18s ease;
    border: 1px solid transparent;
}

.mega-item:hover {
    background: var(--white);
    border-color: var(--brand);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.mega-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.mega-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mega-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

/* Mega Menu 子项标签（HOT / NEW） */
.mega-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
}

.mega-tag-hot {
    background: #fff7e6;
    color: var(--accent);
}

.mega-tag-new {
    background: #dcfce7;
    color: var(--ok);
}

/* ── ⑥ 全屏搜索浮层 ──────────────────────────────────────── */
.wh-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(29, 79, 145, .96);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.wh-search-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.wh-search-overlay-inner {
    width: 100%;
    max-width: 680px;
    padding: 0 20px;
    position: relative;
}

.wh-search-close {
    position: absolute;
    top: -60px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,.1);
    border: none;
    border-radius: 50%;
    color: var(--white);
    font-size: 32px;
    cursor: pointer;
    transition: all var(--transition);
}

.wh-search-close:hover {
    background: rgba(255,255,255,.2);
    transform: rotate(90deg);
}

.wh-search-title {
    color: var(--white);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 32px;
    text-align: center;
}

.wh-search-overlay form {
    display: flex;
    gap: 12px;
}

.wh-search-overlay input[type="search"] {
    flex: 1;
    padding: 16px 24px;
    font-size: 18px;
    background: rgba(255,255,255,.95);
    border: 2px solid transparent;
    border-radius: 8px;
    outline: none;
    transition: all var(--transition);
}

.wh-search-overlay input[type="search"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(200, 163, 90, .2);
}

.wh-search-overlay input[type="submit"] {
    padding: 16px 32px;
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.wh-search-overlay input[type="submit"]:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.wh-search-hot {
    margin-top: 24px;
    text-align: center;
    color: rgba(255,255,255,.7);
    font-size: 14px;
}

.wh-search-hot a {
    display: inline-block;
    margin: 4px 8px;
    padding: 6px 12px;
    background: rgba(255,255,255,.1);
    color: var(--white);
    border-radius: 4px;
    text-decoration: none;
    transition: all .15s ease;
}

.wh-search-hot a:hover {
    background: rgba(255,255,255,.2);
}

/* ── ⑦ 移动端抽屉导航 ────────────────────────────────────── */
.wh-mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: var(--white);
    z-index: 1500;
    transform: translateX(100%);
    transition: transform var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.wh-mobile-drawer.is-active {
    transform: translateX(0);
}

.wh-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--line);
}

.wh-drawer-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
}

.wh-drawer-close {
    width: 36px;
    height: 36px;
    background: var(--bg-soft);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: var(--muted);
    cursor: pointer;
    transition: all .15s ease;
}

.wh-drawer-close:hover {
    background: var(--line);
    color: var(--ink);
}

.wh-drawer-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.drawer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.drawer-item {
    border-bottom: 1px solid var(--line);
}

.drawer-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    color: var(--ink);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all .15s ease;
}

.drawer-link:hover {
    background: var(--bg-soft);
    color: var(--brand);
}

.drawer-arrow {
    font-size: 12px;
    color: var(--muted);
    transition: transform var(--transition);
}

.drawer-item.is-open > .drawer-link .drawer-arrow {
    transform: rotate(180deg);
}

.drawer-sub {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--bg-soft);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
}

.drawer-item.is-open > .drawer-sub {
    max-height: 600px;
}

.drawer-sub li a {
    display: block;
    padding: 12px 40px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    transition: all .15s ease;
}

.drawer-sub li a:hover {
    color: var(--brand);
    padding-left: 44px;
}

.wh-drawer-footer {
    padding: 20px;
    border-top: 1px solid var(--line);
}

.wh-drawer-footer .wh-btn {
    margin-bottom: 16px;
}

.wh-drawer-tel {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.wh-drawer-tel strong {
    display: block;
    margin-top: 4px;
    font-size: 18px;
    color: var(--brand);
}

/* ── ⑧ 遮罩层 ────────────────────────────────────────────── */
.wh-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1400;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.wh-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* ── ⑨ 响应式断点 ────────────────────────────────────────── */

/* ≤ 1024px：平板 → 隐藏主导航、显示汉堡菜单 */
@media (max-width: 1024px) {
    .wh-nav,
    .wh-subbar {
        display: none;
    }

    .wh-menu-toggle {
        display: flex;
    }

    .wh-inline-search {
        display: none;
    }

    .wh-btn-outline {
        display: none;
    }

    .wh-topbar-stats .wh-topbar-pill:nth-child(n+5),
    .wh-topbar-stats .wh-topbar-label:nth-child(n+6) {
        display: none;
    }
}

/* ≤ 768px：手机 */
@media (max-width: 768px) {
    .wh-topbar-contact {
        display: none;
    }

    .wh-topbar-inner {
        justify-content: center;
    }

    .wh-logo-text small {
        display: none;
    }

    .wh-logo-text b {
        font-size: 14px;
    }

    .wh-logo-mark {
        width: 34px;
        height: 34px;
        font-size: 17px;
    }
}

/* ≤ 480px：小屏 */
@media (max-width: 480px) {
    .wh-topbar-stats .wh-topbar-label:nth-child(n+2) {
        display: none;
    }

    .wh-topbar-stats .wh-topbar-pill:nth-child(n+3) {
        display: none;
    }

    .wh-logo-actions .wh-btn-accent {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ── ⑩ 动画 & 无障碍 ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 开屏动画完成后不再拦截交互 */
.wh-open.on.end {
    opacity: 0;
    pointer-events: none;
}

/* body 禁止滚动 */
body.no-scroll {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}

/* ── ⓪⓪ Mega Menu 键盘焦点（无障碍） ─────────────────────── */
.menu-item-mega:focus-within > .sub-menu-mega {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item-has-children:focus-within > .sub-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
