:root {
    --site-bg: #f5f6f8;
    --site-surface: #ffffff;
    --site-surface-soft: #f8f9fb;
    --site-text: #181a1f;
    --site-text-secondary: #4f5663;
    --site-muted: #7b8290;
    --site-border: #e2e5e9;
    --site-border-strong: #d4d8de;
    --site-brand: #4f46e5;
    --site-brand-hover: #4338ca;
    --site-brand-soft: #eeedff;
    --site-success: #087f5b;
    --site-danger: #d92d20;
    --site-warning: #b54708;
    --site-shadow: 0 8px 24px rgba(24, 26, 31, 0.08);
    --site-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.global-nav,
.global-nav * {
    box-sizing: border-box;
}

.global-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 99999;
    height: 56px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--site-border);
    font-family: var(--site-font);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.global-nav__inner {
    width: min(100% - 32px, 1240px);
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

.global-nav .nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    color: var(--site-text);
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
}

.nav-brand__mark {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    color: #ffffff;
    background: var(--site-text);
}

.nav-brand__mark svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.nav-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    border-radius: 7px;
    color: var(--site-text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: color 150ms ease, background 150ms ease;
}

.nav-link:hover {
    color: var(--site-text);
    background: var(--site-surface-soft);
}

.nav-link.active {
    color: var(--site-brand-hover);
    background: var(--site-brand-soft);
    font-weight: 650;
}

.nav-toggle {
    width: 36px;
    height: 36px;
    margin-left: auto;
    display: none;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--site-border);
    border-radius: 7px;
    color: var(--site-text);
    background: var(--site-surface);
    cursor: pointer;
}

.nav-toggle:hover {
    border-color: var(--site-border-strong);
    background: var(--site-surface-soft);
}

.nav-toggle svg {
    width: 19px;
    height: 19px;
}

@media (max-width: 760px) {
    .global-nav__inner {
        width: calc(100% - 24px);
        gap: 12px;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        position: absolute;
        top: 64px;
        left: 12px;
        right: 12px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding: 10px;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-6px);
        border: 1px solid var(--site-border);
        border-radius: 8px;
        background: var(--site-surface);
        box-shadow: var(--site-shadow);
        pointer-events: none;
        transition: opacity 150ms ease, transform 150ms ease;
    }

    .global-nav.is-open .nav-links {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .nav-link {
        width: 100%;
        min-height: 40px;
        justify-content: center;
    }
}

@media print {
    .global-nav {
        display: none !important;
    }
}
