.hq-header-user-dropdown {
    position: relative;
    display: inline-block;
    z-index: 1000;
}

.hq-header-user-dropdown:hover .hq-header-user-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}



.hq-header-user-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
    transition: color var(--transition-fast);
    position: relative;
    z-index: 37;
    margin: 0;
    padding: 0;
    color: var(--color-text-primary, #333);
}

.hq-header-user-toggle:hover {
    color: var(--color-primary, #5E6AD2);
}

.hq-header-user-toggle i {
    font-size: 18px;
    color: inherit;
}

.hq-header-vip-pill {
    margin-left: 4px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-warning, #ff7d00);
    background: rgba(255, 125, 0, 0.1);
    flex-shrink: 0;
}

.hq-header-user-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
    z-index: 99997;
}

.hq-header-user-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

.hq-header-user-panel-slim + .hq-header-user-backdrop,
.hq-header-user-dropdown:has(.hq-header-user-panel-slim) .hq-header-user-backdrop {
    display: none !important;
}

.hq-header-user-panel {
    position: fixed;
    top: auto;
    right: 20px;
    width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 99999;
    overflow: hidden;
    margin-top: 8px;
    box-sizing: border-box;
}

.hq-header-user-panel-slim {
    width: auto;
    min-width: 200px;
    max-width: 400px;
}

.hq-header-user-panel-slim .hq-header-menu-grid {
    grid-template-columns: 1fr;
}

.hq-header-panel-body {
    padding: var(--spacing-sm) var(--spacing-lg);
}

.hq-header-user-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hq-header-panel-header {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.hq-header-user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hq-header-user-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.hq-header-avatar-lg {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--color-border-primary);
    flex-shrink: 0;
}

.hq-header-avatar-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hq-header-user-meta {
    flex: 1;
    min-width: 0;
}

.hq-header-meta-name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.hq-header-meta-desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
}

.hq-header-cert-icon,
.hq-header-vip-icon {
    display: inline-block;
    width: 15px;
    height: 15px;
    vertical-align: middle;
}

.hq-header-vip-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-warning, #ff7d00);
    background: rgba(255, 125, 0, 0.1);
    text-decoration: none;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.hq-header-vip-btn:hover {
    background: rgba(255, 125, 0, 0.2);
}

.hq-header-vip-btn i {
    font-size: var(--font-size-xs);
}

.hq-header-user-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.hq-header-stat-card {
    background: rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) 4px;
    text-align: center;
}

.hq-header-stat-num {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.hq-header-stat-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
}

.hq-header-tab-nav {
    display: flex;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.hq-header-tab-item {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: color var(--transition-fast);
    font-weight: var(--font-weight-medium);
}

.hq-header-tab-item.active {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
}

.hq-header-tab-item:hover {
    color: var(--color-primary);
}

.hq-header-tab-content {
    padding: var(--spacing-sm) var(--spacing-lg);
    min-height: 200px;
}

.hq-header-tab-pane {
    display: none;
}

.hq-header-tab-pane.active {
    display: block;
}

.hq-header-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    width: 100%;
}

.hq-header-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    text-decoration: none;
    color: inherit;
}

.hq-header-menu-item:hover {
    background: rgba(0, 0, 0, 0.08);
}

.hq-header-menu-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
    color: var(--color-text-secondary);
}

.hq-header-menu-text {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
}

.hq-header-menu-desc {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    margin-top: 2px;
}

.hq-header-badge {
    background: var(--color-error, #ff9500);
    color: #ffffff;
    font-size: var(--font-size-xs);
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    font-weight: var(--font-weight-semibold);
    flex-shrink: 0;
}

.hq-header-panel-footer {
    padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.hq-header-logout-btn {
    width: 100%;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 149, 0, 0.08);
    color: var(--color-error, #ff9500);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-align: center;
    cursor: pointer;
    transition: background var(--transition-fast);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.hq-header-logout-btn:hover {
    background: rgba(255, 149, 0, 0.15);
}

[data-theme="dark"] .hq-header-user-toggle {
    color: var(--color-text-primary, #E5E7EB);
}

[data-theme="dark"] .hq-header-user-toggle:hover {
    color: var(--color-primary-light, #7A84E8);
}

[data-theme="dark"] .hq-header-user-backdrop {
    background: rgba(0, 0, 0, 0.65);
}

[data-theme="dark"] .hq-header-user-panel {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .hq-header-panel-header {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .hq-header-meta-name {
    color: var(--color-text-primary);
}

[data-theme="dark"] .hq-header-meta-desc {
    color: var(--color-text-muted);
}

[data-theme="dark"] .hq-header-vip-pill {
    color: var(--color-warning);
    background: rgba(255, 125, 0, 0.15);
}

[data-theme="dark"] .hq-header-vip-btn {
    color: var(--color-warning);
    background: rgba(255, 125, 0, 0.15);
}

[data-theme="dark"] .hq-header-vip-btn:hover {
    background: rgba(255, 125, 0, 0.25);
}

[data-theme="dark"] .hq-header-stat-card {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .hq-header-stat-num {
    color: var(--color-text-primary);
}

[data-theme="dark"] .hq-header-stat-label {
    color: var(--color-text-muted);
}

[data-theme="dark"] .hq-header-tab-nav {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .hq-header-tab-item {
    color: var(--color-text-muted);
}

[data-theme="dark"] .hq-header-menu-item {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .hq-header-menu-item:hover {
    background: rgba(94, 106, 210, 0.1);
}

[data-theme="dark"] .hq-header-menu-icon {
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text-muted);
}

[data-theme="dark"] .hq-header-menu-text {
    color: var(--color-text-primary);
}

[data-theme="dark"] .hq-header-menu-desc {
    color: var(--color-text-muted);
}

[data-theme="dark"] .hq-header-panel-footer {
    border-top-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .hq-header-logout-btn {
    background: rgba(255, 149, 0, 0.1);
    color: var(--color-error);
}

[data-theme="dark"] .hq-header-logout-btn:hover {
    background: rgba(255, 149, 0, 0.18);
}

@media (max-width: 991.98px) {
    .hq-header-user-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        max-height: 93vh;
        margin-top: 0;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        transform: translateY(100%);
        opacity: 0;
        overflow-y: auto;
        box-shadow: 0 -24px 64px rgba(0,0,0,0.14), 0 -6px 20px rgba(0,0,0,0.08);
    }

    .hq-header-user-panel-slim {
        width: 100%;
        max-width: 100%;
    }

    .hq-header-user-panel.open {
        transform: translateY(0);
        opacity: 1;
    }

    .hq-header-user-panel::before {
        content: '';
        display: block;
        width: 34px;
        height: 4px;
        background: var(--color-border-primary);
        border-radius: 2px;
        margin: 8px auto 0;
    }

    .hq-header-user-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .hq-header-menu-grid {
        grid-template-columns: 1fr;
    }

    .hq-header-tab-content {
        min-height: 150px;
    }
}

body.has-fullscreen-slider .site-header.light-slide .hq-header-user-toggle,
body.has-fullscreen-slider .site-header.light-slide .hq-header-user-toggle i {
    color: #333 !important;
}

body.has-fullscreen-slider .site-header.dark-slide .hq-header-user-toggle,
body.has-fullscreen-slider .site-header.dark-slide .hq-header-user-toggle i {
    color: #fff !important;
}

body.has-fullscreen-slider.body-scroll .site-header .hq-header-user-toggle,
body.has-fullscreen-slider.body-scroll .site-header .hq-header-user-toggle i {
    color: #333 !important;
}

body.single.has-article-bg .site-header.light-slide .hq-header-user-toggle,
body.single.has-article-bg .site-header.light-slide .hq-header-user-toggle i {
    color: #2a2a2a !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85) !important;
}

body.single.has-article-bg .site-header.dark-slide .hq-header-user-toggle,
body.single.has-article-bg .site-header.dark-slide .hq-header-user-toggle i {
    color: #fff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
}

body.single.has-article-bg.body-scroll .site-header .hq-header-user-toggle,
body.single.has-article-bg.body-scroll .site-header .hq-header-user-toggle i {
    color: #2a2a2a !important;
    text-shadow: none !important;
}

body.hq-image-detail-page .site-header .hq-header-user-toggle,
body.hq-image-detail-page .site-header .hq-header-user-toggle i {
    color: #fff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
}

body.hq-image-detail-page.body-scroll .site-header .hq-header-user-toggle,
body.hq-image-detail-page.body-scroll .site-header .hq-header-user-toggle i {
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: none !important;
}

body.has-premium-hero .site-header .hq-header-user-toggle,
body.has-premium-hero .site-header .hq-header-user-toggle i {
    color: #fff !important;
}

body.has-premium-hero .site-header.hero-light-bg .hq-header-user-toggle,
body.has-premium-hero .site-header.hero-light-bg .hq-header-user-toggle i {
    color: #1a1d29 !important;
}

body.has-premium-hero.body-scroll .site-header .hq-header-user-toggle,
body.has-premium-hero.body-scroll .site-header .hq-header-user-toggle i {
    color: var(--color-text-primary, #333) !important;
}

body.has-creator-center .site-header .hq-header-user-toggle,
body.has-creator-center .site-header .hq-header-user-toggle i {
    color: #fff !important;
}

body.has-creator-center.body-scroll .site-header .hq-header-user-toggle,
body.has-creator-center.body-scroll .site-header .hq-header-user-toggle i {
    color: #333 !important;
}

body.page-template-member-center .hq-header-user-dropdown {
    position: relative;
    z-index: 10000 !important;
}

body.page-template-member-center .hq-header-user-panel {
    position: fixed !important;
    z-index: 10001 !important;
}

body.page-template-member-center .hq-header-user-toggle {
    z-index: 10002 !important;
}