/* ========================================
   靓号特权 - 视觉特效样式表
   Premium ID Privileges - Visual Effects
   ======================================== */

:root {
    --premium-gold: linear-gradient(135deg, #FFD700, #FFA500, #FF8C00);
    --premium-purple: linear-gradient(135deg, #9b59b6, #8e44ad, #6c3483);
    --premium-rainbow: linear-gradient(135deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    --premium-diamond: linear-gradient(135deg, #E8F5E9, #B2DFDB, #80CBC4);
    --premium-starry: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --premium-aurora: linear-gradient(135deg, #00c9ff, #92fe9d, #00c9ff);
}

/* ========================================
   1. 玻璃拟态化用户名
   ======================================== */

.premium-username-wrapper {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.premium-username {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: linear-gradient(135deg,
            rgba(255, 215, 0, 0.15),
            rgba(255, 165, 0, 0.15),
            rgba(255, 140, 0, 0.15));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid transparent;
    border-radius: 25px;
    position: relative;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow:
        0 8px 32px rgba(255, 215, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    animation: premiumGlow 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

.premium-username::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 25px;
    padding: 2px;
    background: var(--premium-gold);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.premium-username:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 40px rgba(255, 215, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    filter: brightness(1.2) contrast(1.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes premiumGlow {

    0%,
    100% {
        box-shadow:
            0 8px 32px rgba(255, 215, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }

    50% {
        box-shadow:
            0 8px 32px rgba(255, 215, 0, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
}

/* 紫色主题 */
.premium-username.theme-purple {
    background: linear-gradient(135deg,
            rgba(155, 89, 182, 0.15),
            rgba(142, 68, 173, 0.15));
}

.premium-username.theme-purple::before {
    background: var(--premium-purple);
}

/* 彩虹主题 */
.premium-username.theme-rainbow {
    background: linear-gradient(135deg,
            rgba(255, 0, 0, 0.1),
            rgba(255, 127, 0, 0.1),
            rgba(255, 255, 0, 0.1),
            rgba(0, 255, 0, 0.1),
            rgba(0, 0, 255, 0.1));
    animation: rainbowShift 5s linear infinite;
}

.premium-username.theme-rainbow::before {
    background: var(--premium-rainbow);
}

@keyframes rainbowShift {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(360deg);
    }
}

/* 星空主题 */
.premium-username.theme-starry {
    background: linear-gradient(135deg, rgba(15, 12, 41, 0.4), rgba(48, 43, 99, 0.4));
    box-shadow: 0 8px 32px rgba(48, 43, 99, 0.4);
}

.premium-username.theme-starry::before {
    background: var(--premium-starry);
}

/* 极光主题 */
.premium-username.theme-aurora {
    background: linear-gradient(135deg, rgba(0, 201, 255, 0.15), rgba(146, 254, 157, 0.15));
    animation: auroraFlow 4s ease infinite;
}

.premium-username.theme-aurora::before {
    background: var(--premium-aurora);
}

@keyframes auroraFlow {

    0%,
    100% {
        filter: hue-rotate(0deg) brightness(1);
    }

    50% {
        filter: hue-rotate(30deg) brightness(1.2);
    }
}

/* ========================================
   2. 头像框效果
   ======================================== */

.avatar-with-frame {
    position: relative;
    display: inline-block;
}

.avatar-frame-overlay {
    position: absolute;
    inset: -10%;
    pointer-events: none;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: frameRotate 20s linear infinite;
}

.avatar-frame-overlay.animated {
    animation: frameRotate 20s linear infinite, framePulse 2s ease-in-out infinite;
}

@keyframes frameRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes framePulse {

    0%,
    100% {
        opacity: 0.8;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* 金色头像框 */
.avatar-frame-gold {
    border: 3px solid transparent;
    border-radius: 50%;
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.5),
        inset 0 0 20px rgba(255, 215, 0, 0.2);
    position: relative;
}

.avatar-frame-gold::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    padding: 3px;
    background: var(--premium-gold);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* ========================================
   3. 发言特效
   ======================================== */

.premium-comment-effect {
    position: relative;
    animation: commentAppear 0.5s ease-out;
}

@keyframes commentAppear {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    50% {
        transform: translateY(-5px) scale(1.02);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 闪光效果 */
.premium-sparkle {
    position: relative;
    overflow: hidden;
}

.premium-sparkle::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 30%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 70%);
    animation: sparkleMove 3s linear infinite;
}

@keyframes sparkleMove {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* 粒子特效 */
.premium-particles {
    position: relative;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #FFD700, transparent);
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 2s ease-out forwards;
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0);
    }
}

/* ========================================
   4. 点赞特效
   ======================================== */

.premium-like-effect {
    position: relative;
}

.golden-heart {
    position: absolute;
    font-size: 2rem;
    color: #FFD700;
    animation: heartFloat 1s ease-out forwards;
    pointer-events: none;
}

@keyframes heartFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-50px) scale(1.5);
    }
}

/* 粒子动画 - 金色爆发 */
@keyframes premiumParticleMove {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* ========================================
   5. 用户名悬停光晕
   ======================================== */

.premium-username-glow {
    position: relative;
    cursor: pointer;
}

.premium-username-glow::before {
    content: '';
    position: absolute;
    inset: -5px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3), transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.premium-username-glow:hover::before {
    opacity: 1;
    animation: glowPulse 1.5s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* ========================================
   6. 置顶标识
   ======================================== */

.pinned-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    animation: pinBounce 2s ease-in-out infinite;
}

@keyframes pinBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* ========================================
   7. 等级徽章
   ======================================== */

.user-level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--premium-gold);
    color: #000;
    font-size: 0.75rem;
    font-weight: 900;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
    position: relative;
}

.user-level-badge::before {
    content: 'Lv';
    position: absolute;
    top: -8px;
    font-size: 0.6rem;
    opacity: 0.8;
}

/* 精英会员行内小标识 */
.special-id-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--premium-gold);
    color: #000;
    font-weight: 800;
    font-size: 0.7rem;
    border-radius: 6px;
    margin-left: 5px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    vertical-align: middle;
}

/* ========================================
   8. 响应式适配
   ======================================== */

@media (max-width: 768px) {
    .premium-username {
        padding: 6px 15px;
        font-size: 0.9rem;
    }

    .avatar-frame-overlay {
        inset: -8%;
    }
}

/* ========================================
   9. 动画性能优化
   ======================================== */

@media (prefers-reduced-motion: reduce) {

    .premium-username,
    .avatar-frame-overlay,
    .premium-sparkle::after,
    .pinned-badge {
        animation: none;
    }
}

/* ========================================
   10. 打印样式
   ======================================== */

@media print {

    .premium-username::before,
    .avatar-frame-overlay,
    .premium-sparkle::after,
    .particle,
    .golden-heart {
        display: none;
    }
}