/* ============================================================
   私域 AI 产品矩阵 · 共用页头
   私域Chat / 私域Bot Tab 切换（新增项目只需在 site-header.js 里加一条配置）
   ============================================================ */

:root {
    --esh-h: 68px;
    --esh-accent-1: #8b5cf6;
    --esh-accent-2: #6366f1;
    --esh-accent-3: #2563eb;
}

.esh-header,
.esh-header *,
.esh-header *::before,
.esh-header *::after {
    box-sizing: border-box;
}

/* ---------- 布局 ---------- */

.esh-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    height: var(--esh-h);
    background: rgba(10, 12, 24, 0.72);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #fff;
    line-height: 1.2;
}

.esh-header-inner {
    max-width: 1240px;
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ---------- Tab 切换 ---------- */
.esh-tabs {
    position: relative;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex: 0 0 auto;
}

.esh-tabs-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--esh-accent-1), var(--esh-accent-2) 55%, var(--esh-accent-3));
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: left 0.38s cubic-bezier(0.34, 1.35, 0.4, 1), width 0.38s cubic-bezier(0.34, 1.35, 0.4, 1);
    pointer-events: none;
}

.esh-tab {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.62);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.22s ease;
    -webkit-tap-highlight-color: transparent;
}

.esh-tab:hover {
    color: rgba(255, 255, 255, 0.92);
}

.esh-tab.is-active {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.esh-tab svg {
    width: 15px;
    height: 15px;
    display: block;
    flex: 0 0 auto;
}

/* ---------- 站内导航 ---------- */
.esh-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    min-width: 0;
}

.esh-nav a {
    display: inline-block;
    padding: 8px 11px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.esh-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* ---------- CTA ---------- */
.esh-cta {
    margin-left: 8px;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    background: linear-gradient(135deg, var(--esh-accent-1), var(--esh-accent-2));
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    flex: 0 0 auto;
}

.esh-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(99, 102, 241, 0.5);
}

/* ---------- 汉堡按钮 ---------- */
.esh-burger {
    display: none;
    margin-left: auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.esh-burger svg {
    width: 20px;
    height: 20px;
}

.esh-burger .esh-ico-close {
    display: none;
}

.esh-header.is-open .esh-burger .esh-ico-menu {
    display: none;
}

.esh-header.is-open .esh-burger .esh-ico-close {
    display: block;
}

/* ---------- 移动端抽屉 ---------- */
.esh-drawer {
    position: fixed;
    top: var(--esh-h);
    left: 0;
    right: 0;
    z-index: 9998;
    max-height: calc(100vh - var(--esh-h));
    overflow-y: auto;
    padding: 14px 16px 22px;
    background: #0b0e1a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.esh-drawer.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.esh-drawer-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.esh-drawer-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 8px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.esh-drawer-tab svg {
    width: 16px;
    height: 16px;
}

.esh-drawer-tab.is-active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--esh-accent-1), var(--esh-accent-2));
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.4);
}

.esh-drawer-nav {
    display: grid;
    gap: 2px;
    margin-bottom: 14px;
}

.esh-drawer-nav a {
    padding: 13px 10px;
    border-radius: 12px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
}

.esh-drawer-nav a:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.esh-drawer-cta {
    display: block;
    padding: 13px;
    border-radius: 999px;
    text-align: center;
    font-size: 14.5px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, var(--esh-accent-1), var(--esh-accent-2));
    box-shadow: 0 10px 26px rgba(99, 102, 241, 0.4);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1150px) {
    .esh-nav a {
        padding: 8px 8px;
        font-size: 13px;
    }
}

@media (max-width: 1080px) {
    .esh-nav,
    .esh-cta {
        display: none;
    }

    .esh-burger {
        display: flex;
    }
}

@media (max-width: 560px) {
    .esh-header-inner {
        padding: 0 14px;
        gap: 10px;
    }

    .esh-tab {
        padding: 8px 13px;
        font-size: 13px;
    }
}

/* 锚点跳转时给固定页头留出空间 */
section[id] {
    scroll-margin-top: calc(var(--esh-h) + 14px);
}
