# Header chrome: keep paint cheap, keep the current look.

.qk-header-chrome {
    background: linear-gradient(rgba(12, 6, 18, 0.75), rgba(12, 6, 18, 0.85)), url("/img/header-bg.webp") center/cover no-repeat;
    border-bottom: 1px solid rgba(88, 28, 135, 0.4);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.qk-header-chrome.convert-studio-topbar {
    background: #161018;
    box-shadow: none;
}

.qk-header-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "lead"
        "actions";
    align-items: center;
    column-gap: 8px;
    row-gap: 4px;
    padding: 0;
}

.qk-header-lead {
    grid-area: lead;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas: "logo cat search";
    align-items: center;
    column-gap: 8px;
    min-width: 0;
    padding: 8px 10px 4px;
}

.qk-header-logo {
    grid-area: logo;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qk-header-logo::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.42) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: qk-logo-aura 4s ease-in-out infinite;
}

.qk-header-logo__img {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.qk-header-logo:hover .qk-header-logo__img {
    transform: scale(1.08);
}

.qk-header-cat { grid-area: cat; position: relative; }
.qk-header-search { grid-area: search; min-width: 0; }

.qk-header-actions {
    grid-area: actions;
    min-width: 0;
    padding: 6px 10px 8px;
}

.qk-header-actions__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 4px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.qk-header-actions__row::-webkit-scrollbar { display: none; }

.qk-header-search form {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.qk-header-search input {
    border: 0 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
}

.qk-header-admin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 10px;
    flex-shrink: 0;
    border-radius: 999px;
    background: #e11d48;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}
.qk-header-admin:hover { background: #b91c1c; }

.qk-header-lt {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 6px;
    flex-shrink: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #4fafa7;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.qk-header-lt:hover { background: rgba(255, 255, 255, 0.08); }

.qk-header-auth {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 9px;
    flex-shrink: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.qk-header-auth:hover { background: rgba(255, 255, 255, 0.16); }

.lt-coin {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2372bfb9' d='M12 1L6 11l6 11z'/%3E%3Cpath fill='%23368781' d='M12 1l6 10-6 11z'/%3E%3Cpath fill='%23c1f5f0' d='M5 8L1 16l11 6z'/%3E%3Cpath fill='%234fafa7' d='M5 8l7 14-3-7z'/%3E%3Cpath fill='%2372bfb9' d='M19 8l-4 7-3 7z'/%3E%3Cpath fill='%231F6964' d='M19 8l-7 14 11-6z'/%3E%3Cpath fill='%23bdf1ec' d='M12 15L9 19l3 3z'/%3E%3Cpath fill='%234fafa7' d='M12 15l3 4-3 3z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: qk-lt-pulse 2.5s infinite ease-in-out;
}

.qk-user-cluster {
    display: inline-flex;
    align-items: stretch;
    height: 32px;
    max-width: 140px;
    flex-shrink: 0;
    gap: 2px;
}

.qk-user-cluster__name {
    min-width: 0;
    max-width: 108px;
    display: inline-flex;
    align-items: center;
    padding: 0 4px 0 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    border-radius: 8px;
}
.qk-user-cluster__name:hover { background: rgba(255, 255, 255, 0.08); }
.qk-user-cluster__name span { font-weight: 800; }

.qk-user-cluster__logout { display: flex; margin: 0; }
.qk-user-cluster__logout button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
}
.qk-user-cluster__logout button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fda4af;
}
.qk-user-cluster__logout svg { width: 13px; height: 13px; }

.qk-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    flex-shrink: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}
.qk-theme-toggle__swatch {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: conic-gradient(#e8b84c 0 22%, #d6c29c 22% 42%, #aeb4bc 42% 62%, #657080 62% 80%, #303030 80% 100%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
}
.qk-theme-toggle:hover,
.qk-theme-toggle[aria-expanded="true"] { background: rgba(255, 255, 255, 0.08); }

.qk-header-cat > div > button {
    border: 0 !important;
    background: transparent !important;
    padding: 6px !important;
    border-radius: 8px;
}
.qk-header-cat > div > button:hover { background: rgba(255, 255, 255, 0.08) !important; }

.qk-header-actions .relative > button,
.qk-header-actions .relative > div > button {
    height: 32px;
    min-height: 32px;
    padding: 0 8px;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.qk-header-actions .relative > button:hover,
.qk-header-actions .relative > div > button:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

.ascension-btn {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0 0.78rem;
    gap: 0.34rem;
    overflow: hidden;
    border: 1px solid rgba(94, 234, 212, 0.34);
    border-radius: 0.55rem;
    color: #ccfbf1;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(17, 24, 39, 0.94) 48%, rgba(49, 46, 129, 0.72) 100%);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
}
.ascension-btn__glyph {
    width: 0.86rem;
    height: 0.86rem;
    flex: 0 0 auto;
    color: #99f6e4;
}
.ascension-btn--panel {
    min-height: 2.25rem;
    padding: 0 1rem;
    font-size: 0.86rem;
}
.qk-header-actions .ascension-btn {
    flex-shrink: 0;
    min-height: 28px;
    padding: 0 0.55rem;
    font-size: 0.64rem;
    gap: 0.22rem;
    border: 0;
    background: rgba(45, 212, 191, 0.14);
    color: #99f6e4;
    white-space: nowrap;
}
.qk-header-actions .ascension-btn__glyph { width: 0.72rem; height: 0.72rem; }
.qk-header-actions .ascension-btn:hover { background: rgba(45, 212, 191, 0.22); }

.qk-cat-menu,
.qk-notice-panel {
    position: fixed;
    z-index: 1000000;
    width: min(320px, calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-height: min(70dvh, 520px);
    margin: 0;
    border: 1px solid var(--qk-reader-line, #e2e8f0);
    border-radius: 14px;
    background: var(--qk-reader-paper, #fff);
    box-shadow: 0 14px 36px var(--qk-reader-shadow, rgba(15, 23, 42, 0.16));
    color: var(--qk-reader-text, #0f172a);
}
.qk-cat-menu { padding: 10px; overflow: auto; overscroll-behavior: contain; }
.qk-notice-panel { overflow: hidden; }
.qk-cat-menu__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}
.qk-cat-menu__item {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 38px;
    padding: 0 8px;
    border-radius: 9px;
    border: 1px solid var(--qk-reader-line, #e2e8f0);
    background: var(--qk-reader-paper-soft, #f8fafc);
    color: var(--qk-reader-text, #0f172a);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qk-cat-menu__item:hover { border-color: var(--qk-reader-accent, #287e77); }

.qk-notice-panel__head,
.qk-notice-panel__foot { padding: 10px 12px; }
.qk-notice-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 8px;
}
.qk-notice-panel__title { font-size: 12px; font-weight: 800; }
.qk-notice-panel__count { font-size: 11px; font-weight: 700; color: var(--qk-reader-muted, #64748b); }
.qk-notice-panel__list { max-height: min(48dvh, 360px); overflow: auto; overscroll-behavior: contain; }
.qk-notice-panel__item { display: block; padding: 10px 12px; text-decoration: none; color: inherit; }
.qk-notice-panel__item:hover { background: var(--qk-reader-paper-soft, #f8fafc); }
.qk-notice-panel__text { margin: 0; font-size: 12px; font-weight: 500; line-height: 1.45; }
.qk-notice-panel__time { margin: 4px 0 0; font-size: 11px; color: var(--qk-reader-muted, #64748b); }
.qk-notice-panel__empty { padding: 28px 12px; text-align: center; font-size: 12px; color: var(--qk-reader-muted, #64748b); }
.qk-notice-panel__all {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    border: 1px solid var(--qk-reader-line, #e2e8f0);
    border-radius: 9px;
    background: var(--qk-reader-paper-soft, #f8fafc);
    color: var(--qk-reader-text, #0f172a);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.header-tabs-wrapper {
    background: transparent;
    border-bottom: 0;
}
.header-tabs-wrapper nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.header-tabs-wrapper nav::-webkit-scrollbar { display: none; }

.qk-header-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.qk-header-tabs::-webkit-scrollbar { display: none; }

.qk-header-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 12px;
    border: 1px solid var(--qk-reader-line, #e2e8f0);
    border-radius: 999px;
    background: var(--qk-reader-paper, #fff);
    box-shadow: 0 1px 2px var(--qk-reader-shadow, rgba(15, 23, 42, 0.06));
    color: var(--qk-reader-text, #334155);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.qk-header-tab svg { width: 14px; height: 14px; }
.qk-header-tab:hover {
    background: var(--qk-reader-paper-soft, #f8fafc);
    box-shadow: 0 2px 6px var(--qk-reader-shadow, rgba(15, 23, 42, 0.1));
}
.header-tab-active {
    box-shadow: 0 0 0 1px var(--qk-reader-accent, #287e77), 0 1px 2px var(--qk-reader-shadow, rgba(15, 23, 42, 0.08)) !important;
}

@keyframes qk-logo-aura {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}
@keyframes qk-lt-pulse {
    0%, 100% { transform: scale(1); opacity: 0.86; }
    50% { transform: scale(1.08); opacity: 1; }
}

@media (min-width: 768px) {
    .qk-header-bar {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "lead actions";
        row-gap: 0;
        padding: 8px 0;
    }
    .qk-header-search { max-width: 28rem; }
    .qk-header-lead,
    .qk-header-actions { padding: 0; }
    .qk-header-actions__row {
        width: max-content;
        justify-content: flex-end;
        gap: 6px;
        margin-left: auto;
    }
    .qk-header-chrome {
        position: sticky;
        top: 0;
        z-index: 80;
        transform: translateZ(0);
    }
    .qk-header-lead,
    .qk-header-actions {
        background: none !important;
    }
}

@media (max-width: 767.98px) {
    .qk-header-chrome,
    .qk-header-container,
    .qk-header-bar { display: contents; }

    .qk-header-lead {
        background: linear-gradient(rgba(12, 6, 18, 0.75), rgba(12, 6, 18, 0.85)), url("/img/header-bg.webp") center/cover no-repeat;
    }
    .qk-header-actions {
        position: sticky;
        top: 0;
        z-index: 80;
        background: linear-gradient(rgba(12, 6, 18, 0.75), rgba(12, 6, 18, 0.85)), url("/img/header-bg.webp") center/cover no-repeat;
        border-bottom: 1px solid rgba(88, 28, 135, 0.4);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        transform: translateZ(0);
    }
    .qk-header-chrome.convert-studio-topbar .qk-header-lead,
    .qk-header-chrome.convert-studio-topbar .qk-header-actions {
        background: #161018;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qk-header-logo::after,
    .lt-coin {
        animation: none;
    }
    .qk-header-logo__img { transition: none; }
}
