/* 全站通用内容宽度：外层留白由 width 计算，容器内不再 padding */
.qb-container,
.container {
    width: min(1200px, calc(100% - 40px));
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}

.qb-header {
    position: sticky;
    top: 0;
    z-index: 200;
    height: 86px;
    border-bottom: 1px solid #edf2f7;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.qb-header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.qb-header-bar {
    display: contents;
}

.qb-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.qb-logo {
    display: block;
    line-height: 0;
    max-height: 48px;
    max-width: min(220px, 46vw);
}

.qb-logo img {
    display: block;
    max-height: 48px;
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.qb-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.qb-menu-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.qb-header.is-menu-open .qb-menu-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.qb-header.is-menu-open .qb-menu-toggle-bar:nth-child(2) {
    opacity: 0;
}

.qb-header.is-menu-open .qb-menu-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.qb-header-panel {
    display: flex;
    align-items: center;
    gap: 28px;
    flex: 1;
    min-width: 0;
}

.qb-nav {
    display: flex;
    align-items: center;
    gap: 36px;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.qb-nav a {
    position: relative;
    padding: 30px 0;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.qb-nav a:visited {
    color: inherit;
}

.qb-nav a:hover {
    color: #16a34a;
}

.qb-nav a.active {
    color: #16a34a;
}

.qb-nav a.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 20px;
    width: 24px;
    height: 3px;
    border-radius: 999px;
    background: #16a34a;
    transform: translateX(-50%);
}

.qb-search {
    margin-left: auto;
    display: flex;
    align-items: center;
    width: min(348px, 100%);
    flex-shrink: 0;
    gap: 0;
}

.qb-search input,
.qb-search button {
    box-sizing: border-box;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    margin: 0;
    padding: 0;
    border: 1px solid #e5e7eb;
    vertical-align: top;
    -webkit-appearance: none;
    appearance: none;
}

.qb-search input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    outline: 0;
    padding: 0 14px;
    color: #111827;
    font-size: 14px;
    line-height: 1.2;
    background-color: #fff;
    -webkit-appearance: none;
    appearance: none;
    border-right: 0;
    border-radius: 8px 0 0 8px;
}

.qb-search input::-webkit-search-cancel-button,
.qb-search input::-webkit-search-decoration {
    -webkit-appearance: none;
}

.qb-search button {
    flex: 0 0 48px;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    border-color: #16a34a;
    border-radius: 0 8px 8px 0;
    background: #16a34a;
    color: #fff;
    cursor: pointer;
}

.qb-search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    pointer-events: none;
}

.qb-search-icon svg {
    display: block;
    width: 18px;
    height: 18px;
}

@media (max-width: 1100px) {
    .qb-header-inner {
        gap: 18px;
    }

    .qb-nav {
        gap: 22px;
    }

    .qb-search {
        width: min(284px, 100%);
    }

    .qb-search button {
        flex-basis: 44px;
        width: 44px;
    }
}

@media (max-width: 980px) {
    .qb-header {
        height: auto;
    }

    .qb-header-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        gap: 0;
    }

    .qb-header-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 64px;
        width: 100%;
    }

    .qb-menu-toggle {
        display: inline-flex;
        margin-left: 0;
    }

    .qb-header-panel {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 0 0 12px;
    }

    .qb-header.is-menu-open .qb-header-panel {
        display: flex;
    }

    .qb-header .qb-search {
        display: none;
    }

    .qb-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        border: 1px solid #eef2f7;
        border-radius: 12px;
        overflow: hidden;
        background: #fff;
    }

    .qb-nav a {
        padding: 14px 16px;
        border-bottom: 1px solid #eef2f7;
    }

    .qb-nav a:last-child {
        border-bottom: 0;
    }

    .qb-nav a.active::after {
        display: none;
    }

    .qb-nav a.active {
        background: #ecfdf5;
    }
}

@media (max-width: 560px) {
    .qb-container,
    .container {
        width: min(1200px, calc(100% - 32px));
    }

    .qb-logo {
        max-width: min(180px, 52vw);
    }

    .qb-logo img {
        max-height: 40px;
    }
}
