/* 顶栏会员中心面板 */

#header-navbar .nav-user {
    position: relative;
}

.navbar-fixed-top .navbar-collapse {
    overflow: visible;
}

@media (max-width: 767px) {
    .navbar-fixed-top .navbar-collapse.in {
        overflow-y: auto;
    }
}

#header-navbar .nav-user > .nav-user-toggle {
    display: flex;
    align-items: center;
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    height: 60px !important;
}

#header-navbar .nav-user .avatar-img,
#header-navbar .nav-user .avatar-img img {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
}

.user-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: -4px;
    z-index: 2000;
    width: 372px;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    background: transparent;
}

.user-panel[hidden] {
    display: none !important;
}

.user-panel-inner {
    position: relative;
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.user-panel-inner::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 18px;
    width: 12px;
    height: 12px;
    background: #eef6ff;
    border-left: 1px solid rgba(15, 23, 42, 0.06);
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    transform: rotate(45deg);
    z-index: 3;
}

/* 仅清导航污染，不覆盖组件自身背景/间距 */
.user-panel a {
    float: none !important;
    height: auto !important;
    line-height: inherit !important;
    text-decoration: none !important;
    white-space: normal !important;
    box-shadow: none !important;
}

.user-panel-hd {
    position: relative;
    z-index: 1;
    padding: 18px 16px 14px;
    background:
        radial-gradient(140px 100px at 88% 0%, rgba(59, 130, 246, 0.18), transparent 68%),
        linear-gradient(180deg, #eef6ff 0%, #ffffff 85%);
}

.user-panel-hd-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-panel a.user-panel-avatar {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    margin: 0;
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #e8ecf3;
    display: block;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.user-panel-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.user-panel-meta {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 4px;
}

.user-panel-name {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-panel-lv {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 6px;
    padding: 2px 9px 2px 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, #34d399, #10b981);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}

.user-panel-lv i {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
}

.user-panel a.user-panel-logout {
    flex: 0 0 34px;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px;
    min-height: 34px;
    margin: 0 0 0 auto;
    padding: 0 !important;
    border: 0;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    color: #2b2f36;
    background: rgba(15, 23, 42, 0.06);
    box-shadow: none !important;
    line-height: 1 !important;
    transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.user-panel-logout-ico {
    display: block;
    width: 18px;
    height: 18px;
}

.user-panel a.user-panel-logout:hover {
    color: #fff;
    background: #2b2f36;
}

.user-panel a.user-panel-logout:active {
    background: #1a1d22;
    transform: scale(0.96);
}

.user-panel-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 16px;
    padding: 10px 4px 2px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    text-align: center;
}

.user-panel-stats span {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.2;
}

.user-panel-stats b {
    display: block;
    margin-top: 5px;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.user-panel-body {
    padding: 4px 14px 14px;
}

.user-panel-wallet {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 8px;
    margin: 2px 0 12px;
}

.user-panel a.user-panel-wallet-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    margin: 0;
    padding: 8px 12px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s ease;
}

.user-panel a.user-panel-wallet-item:hover {
    background: #e2e8f0;
}

.user-panel a.user-panel-wallet-item:first-child {
    background: #e8f3ff;
}

.user-panel a.user-panel-wallet-item:first-child:hover {
    background: #d6e9ff;
}

.user-panel-wallet-item .ico {
    color: #1677ff;
    font-size: 15px;
    width: 18px;
    text-align: center;
    flex: 0 0 18px;
}

.user-panel-wallet-item .wallet-txt {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    line-height: 1.2;
}

.user-panel-wallet-item .wallet-txt em {
    font-style: normal;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
}

.user-panel-wallet-item .wallet-txt b {
    font-weight: 700;
    font-size: 14px;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.user-panel-wallet-item .wallet-add {
    margin-left: auto;
    color: #1677ff;
    font-size: 16px;
    opacity: 0.9;
}

.user-panel a.user-panel-task {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin: 0 0 12px;
    padding: 0 16px;
    border-radius: 999px;
    background: linear-gradient(90deg, #60a5fa 0%, #1677ff 55%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(22, 119, 255, 0.25);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.user-panel a.user-panel-task:hover {
    color: #fff;
    opacity: 0.95;
    transform: translateY(-1px);
}

.user-panel-task .heart {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
}

.user-panel-task > span:last-child {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.01em;
    text-align: center;
}

.user-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 4px;
}

.user-panel a.user-panel-grid-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 10px 8px;
    border-radius: 10px;
    color: inherit;
    transition: background 0.15s ease;
}

.user-panel a.user-panel-grid-item:hover {
    background: #f8fafc;
}

.user-panel-grid-item .ico {
    flex: 0 0 22px;
    width: 22px;
    margin-top: 1px;
    color: #1677ff;
    font-size: 17px;
    line-height: 22px;
    text-align: center;
}

.user-panel-grid-item .txt {
    min-width: 0;
    flex: 1;
}

.user-panel-grid-item .tit {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

.user-panel-grid-item .sub {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.35;
}

.user-panel-new {
    display: inline-block;
    padding: 0 4px;
    margin-left: 4px;
    border-radius: 3px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    font-style: normal;
    line-height: 14px;
    vertical-align: middle;
}

@media (max-width: 767px) {
    .user-panel {
        position: fixed;
        top: 56px;
        right: 12px;
        left: auto;
        width: calc(100vw - 24px);
        max-width: 372px;
    }

    .user-panel-inner::before {
        display: none;
    }
}
