/* 头像框样式库 */

/* ========== 基础头像框容器（强制圆形） ========== */
.avatar-frame {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.avatar-frame img,
.avatar-frame .avatar-inner {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* 确保所有头像都是正圆 */
.avatar,
.avatar-frame,
.avatar-frame img,
.avatar-frame .avatar-inner {
    aspect-ratio: 1 / 1;
    border-radius: 50% !important;
}

/* ========== 赞助等级头像框 ========== */

/* 支持者 - 星光银 */
.frame-supporter {
    padding: 3px;
    background: linear-gradient(135deg, #C0C0C0, #E8E8E8, #C0C0C0);
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.6);
}

/* 守护者 - 梦幻紫 */
.frame-guardian {
    padding: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
    animation: frame-glow-purple 2s ease-in-out infinite;
}

@keyframes frame-glow-purple {
    0%, 100% { box-shadow: 0 0 15px rgba(102, 126, 234, 0.6); }
    50% { box-shadow: 0 0 25px rgba(102, 126, 234, 0.9); }
}

/* 创始人 - 尊贵金 */
.frame-founder {
    padding: 5px;
    background: linear-gradient(135deg, #FFD700, #FFA500, #FF6347, #FFD700);
    background-size: 300% 300%;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
    animation: frame-gold-move 3s ease infinite;
}

@keyframes frame-gold-move {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========== 特殊头像框 ========== */

/* 彩虹框 */
.frame-rainbow {
    padding: 4px;
    background: linear-gradient(135deg, 
        #ff0000, #ff7f00, #ffff00, #00ff00, 
        #0000ff, #4b0082, #9400d3, #ff0000);
    background-size: 400% 400%;
    animation: rainbow-shift 5s linear infinite;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

@keyframes rainbow-shift {
    0% { background-position: 0% 50%; }
    100% { background-position: 400% 50%; }
}

/* 火焰框 */
.frame-fire {
    padding: 4px;
    background: linear-gradient(135deg, #ff4500, #ff6600, #ff8c00, #ff4500);
    background-size: 200% 200%;
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.7);
    animation: fire-flicker 0.5s ease-in-out infinite;
}

@keyframes fire-flicker {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 69, 0, 0.7); }
    50% { box-shadow: 0 0 25px rgba(255, 69, 0, 0.9); }
}

/* 冰霜框 */
.frame-ice {
    padding: 4px;
    background: linear-gradient(135deg, #00bfff, #87ceeb, #b0e0e6, #00bfff);
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.6);
    animation: ice-sparkle 2s ease-in-out infinite;
}

@keyframes ice-sparkle {
    0%, 100% { box-shadow: 0 0 15px rgba(0, 191, 255, 0.6); }
    50% { box-shadow: 0 0 25px rgba(135, 206, 250, 0.9); }
}

/* 星空框 */
.frame-star {
    padding: 4px;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    box-shadow: 0 0 20px rgba(48, 43, 99, 0.8);
    position: relative;
}

.frame-star::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.3) 1px, transparent 1px),
                radial-gradient(circle at 80% 40%, rgba(255,255,255,0.2) 1px, transparent 1px),
                radial-gradient(circle at 40% 80%, rgba(255,255,255,0.3) 1px, transparent 1px);
    animation: star-twinkle 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes star-twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 樱花框 */
.frame-sakura {
    padding: 4px;
    background: linear-gradient(135deg, #ffb7c5, #ffc0cb, #ffb6c1, #ff69b4);
    box-shadow: 0 0 20px rgba(255, 182, 193, 0.6);
    animation: sakura-glow 3s ease-in-out infinite;
}

@keyframes sakura-glow {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 182, 193, 0.6); }
    50% { box-shadow: 0 0 25px rgba(255, 105, 180, 0.8); }
}

/* 翡翠框 */
.frame-emerald {
    padding: 4px;
    background: linear-gradient(135deg, #50c878, #2ecc71, #3cb371, #50c878);
    box-shadow: 0 0 20px rgba(80, 200, 120, 0.6);
    animation: emerald-shine 2s ease-in-out infinite;
}

@keyframes emerald-shine {
    0%, 100% { box-shadow: 0 0 15px rgba(80, 200, 120, 0.6); }
    50% { box-shadow: 0 0 25px rgba(46, 204, 113, 0.8); }
}

/* ========== 炫彩ID样式 ========== */

.id-rainbow {
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: id-rainbow-flow 5s linear infinite;
    font-weight: 600;
}

@keyframes id-rainbow-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 400% 50%; }
}

.id-fire {
    background: linear-gradient(90deg, #ff4500, #ff6600, #ff8c00, #ff4500);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: id-fire-flow 1s linear infinite;
    font-weight: 600;
}

@keyframes id-fire-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.id-ice {
    background: linear-gradient(90deg, #00bfff, #87ceeb, #b0e0e6, #00bfff);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: id-ice-flow 2s linear infinite;
    font-weight: 600;
}

@keyframes id-ice-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.id-gold {
    background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    font-weight: 600;
}

.id-purple {
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: id-purple-flow 2s linear infinite;
    font-weight: 600;
}

@keyframes id-purple-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.id-pink {
    background: linear-gradient(90deg, #ff69b4, #ff1493, #ff69b4);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: id-pink-flow 2s linear infinite;
    font-weight: 600;
}

@keyframes id-pink-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* ========== 预览样式 ========== */
.frame-preview {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.frame-preview .avatar-inner {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
}

/* ========== 暗黑模式适配 ========== */
[data-theme="dark"] .frame-supporter {
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.8);
}

[data-theme="dark"] .frame-guardian {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
}

[data-theme="dark"] .frame-founder {
    box-shadow: 0 0 25px rgba(255, 215, 0, 1);
}

[data-theme="dark"] .frame-rainbow {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .frame-fire {
    box-shadow: 0 0 25px rgba(255, 69, 0, 0.9);
}

[data-theme="dark"] .frame-ice {
    box-shadow: 0 0 25px rgba(0, 191, 255, 0.8);
}

[data-theme="dark"] .frame-star {
    box-shadow: 0 0 25px rgba(100, 100, 200, 1);
}

[data-theme="dark"] .frame-sakura {
    box-shadow: 0 0 25px rgba(255, 105, 180, 1);
}

[data-theme="dark"] .frame-emerald {
    box-shadow: 0 0 25px rgba(46, 204, 113, 1);
}

/* ========== 勋章样式库 (Badge Styles) ========== */

/* 勋章基础容器 */
.shop-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.shop-badge .badge-inner {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: bold;
    color: #fff;
    position: relative;
    z-index: 2;
}

/* 勋章绶带（底部装饰） */
.shop-badge .badge-ribbon {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 18px;
    z-index: 1;
    clip-path: polygon(0 0, 100% 0, 85% 100%, 15% 100%);
}

/* 勋章星星光芒 */
.shop-badge .badge-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* ---- 金牌勋章 ---- */
.badge-gold .badge-inner {
    background: linear-gradient(145deg, #FFD700, #FFA500, #FFD700);
    box-shadow: 0 3px 12px rgba(255, 215, 0, 0.6), inset 0 2px 4px rgba(255,255,255,0.5);
}
.badge-gold .badge-ribbon { background: linear-gradient(180deg, #DC143C, #8B0000); }
.badge-gold .badge-glow { background: radial-gradient(circle, rgba(255,215,0,0.25) 0%, transparent 70%); }

/* ---- 银牌勋章 ---- */
.badge-silver .badge-inner {
    background: linear-gradient(145deg, #E8E8E8, #C0C0C0, #A8A8A8);
    box-shadow: 0 3px 12px rgba(192, 192, 192, 0.6), inset 0 2px 4px rgba(255,255,255,0.7);
    color: #444;
}
.badge-silver .badge-ribbon { background: linear-gradient(180deg, #4169E1, #191970); }
.badge-silver .badge-glow { background: radial-gradient(circle, rgba(192,192,192,0.25) 0%, transparent 70%); }

/* ---- 铜牌勋章 ---- */
.badge-bronze .badge-inner {
    background: linear-gradient(145deg, #CD7F32, #B87333, #8B4513);
    box-shadow: 0 3px 12px rgba(184, 115, 51, 0.6), inset 0 2px 4px rgba(255,255,255,0.3);
}
.badge-bronze .badge-ribbon { background: linear-gradient(180deg, #228B22, #006400); }
.badge-bronze .badge-glow { background: radial-gradient(circle, rgba(184,115,51,0.25) 0%, transparent 70%); }

/* ---- 皇冠勋章 ---- */
.badge-crown .badge-inner {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    box-shadow: 0 3px 20px rgba(255, 215, 0, 0.7), inset 0 2px 4px rgba(255,255,255,0.5);
    border-radius: 50% 50% 40% 40%;
}
.badge-crown::before {
    content: '♔';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: #FFD700;
    text-shadow: 0 0 6px rgba(255,215,0,0.8);
    z-index: 3;
}
.badge-crown .badge-ribbon { background: linear-gradient(180deg, #800080, #4B0082); }
.badge-crown .badge-glow { background: radial-gradient(circle, rgba(255,215,0,0.35) 0%, transparent 70%); animation: crown-pulse 2s ease-in-out infinite; }
@keyframes crown-pulse {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

/* ---- 星光勋章 ---- */
.badge-star .badge-inner {
    background: linear-gradient(145deg, #667eea, #764ba2);
    box-shadow: 0 3px 16px rgba(102, 126, 234, 0.7);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    width: 56px; height: 56px; border-radius: 0;
}
.badge-star .badge-ribbon { background: linear-gradient(180deg, #1a1a2e, #16213e); }
.badge-star .badge-glow { background: radial-gradient(circle, rgba(102,126,234,0.3) 0%, transparent 70%); animation: star-badge-twinkle 1.5s ease-in-out infinite; }
@keyframes star-badge-twinkle {
    0%, 100% { opacity: 0.5; } 50% { opacity: 1; }
}

/* ---- 爱心勋章 ---- */
.badge-heart .badge-inner {
    background: linear-gradient(145deg, #ff6b9d, #ff1493, #c71585);
    box-shadow: 0 3px 16px rgba(255, 20, 147, 0.6);
    border-radius: 50% 50% 45% 45%;
}
.badge-heart::before {
    content: '♥';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -55%);
    font-size: 18px;
    color: rgba(255,255,255,0.9);
    z-index: 3;
}
.badge-heart .badge-ribbon { background: linear-gradient(180deg, #db7093, #8b0000); }
.badge-heart .badge-glow { background: radial-gradient(circle, rgba(255,20,147,0.25) 0%, transparent 70%); animation: heart-beat 1.2s ease-in-out infinite; }
@keyframes heart-beat {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    15% { transform: translate(-50%, -50%) scale(1.1); }
    30% { transform: translate(-50%, -50%) scale(1); }
    45% { transform: translate(-50%, -50%) scale(1.08); }
    60% { transform: translate(-50%, -50%) scale(1); }
}

/* ---- 闪电勋章 ---- */
.badge-lightning .badge-inner {
    background: linear-gradient(145deg, #FFE066, #F4C430, #FFD700);
    box-shadow: 0 3px 16px rgba(244, 196, 48, 0.7);
    color: #333;
}
.badge-lightning::before {
    content: '⚡';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -55%);
    font-size: 18px;
    z-index: 3;
}
.badge-lightning .badge-ribbon { background: linear-gradient(180deg, #FFD700, #B8860B); }
.badge-lightning .badge-glow { background: radial-gradient(circle, rgba(244,196,48,0.3) 0%, transparent 70%); animation: lightning-flash 0.8s step-end infinite; }
@keyframes lightning-flash {
    0%, 100% { opacity: 0.4; } 50% { opacity: 1; }
}

/* ---- 钻石勋章 ---- */
.badge-diamond .badge-inner {
    background: linear-gradient(145deg, #b9f2ff, #80dfff, #4dc9ff, #00bfff, #4dc9ff, #80dfff, #b9f2ff);
    background-size: 200% 200%;
    box-shadow: 0 3px 20px rgba(0, 191, 255, 0.6), inset 0 1px 3px rgba(255,255,255,0.8);
    clip-path: polygon(50% 0%, 85% 25%, 100% 60%, 75% 100%, 25% 100%, 0% 60%, 15% 25%);
    width: 54px; height: 54px; border-radius: 0;
    animation: diamond-shimmer 3s ease-in-out infinite;
}
.badge-diamond .badge-ribbon { background: linear-gradient(180deg, #4682B4, #191970); }
.badge-diamond .badge-glow { background: radial-gradient(circle, rgba(0,191,255,0.25) 0%, transparent 70%); }
@keyframes diamond-shimmer {
    0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; }
}

/* ---- 烈焰勋章 ---- */
.badge-fire .badge-inner {
    background: linear-gradient(145deg, #ff4500, #ff6600, #ff8c00, #ff4500);
    background-size: 200% 200%;
    box-shadow: 0 3px 18px rgba(255, 69, 0, 0.7);
    animation: fire-badge-flicker 0.4s ease-in-out infinite;
}
.badge-fire::before {
    content: '🔥';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -55%);
    font-size: 16px;
    z-index: 3;
}
.badge-fire .badge-ribbon { background: linear-gradient(180deg, #8B0000, #2F0000); }
.badge-fire .badge-glow { background: radial-gradient(circle, rgba(255,69,0,0.3) 0%, transparent 70%); }
@keyframes fire-badge-flicker {
    0%, 100% { background-position: 0% 50%; box-shadow: 0 3px 14px rgba(255,69,0,0.6); }
    50% { background-position: 100% 50%; box-shadow: 0 3px 22px rgba(255,69,0,0.9); }
}

/* ---- 冰霜勋章 ---- */
.badge-ice .badge-inner {
    background: linear-gradient(145deg, #e0f7fa, #80deea, #4dd0e1, #00bcd4);
    box-shadow: 0 3px 16px rgba(0, 188, 212, 0.6), inset 0 1px 3px rgba(255,255,255,0.7);
    color: #006064;
}
.badge-ice::before {
    content: '❄';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -55%);
    font-size: 18px;
    z-index: 3;
}
.badge-ice .badge-ribbon { background: linear-gradient(180deg, #4fc3f7, #0277bd); }
.badge-ice .badge-glow { background: radial-gradient(circle, rgba(0,188,212,0.25) 0%, transparent 70%); animation: ice-crystal 2.5s ease-in-out infinite; }
@keyframes ice-crystal {
    0%, 100% { opacity: 0.5; } 50% { opacity: 1; }
}

/* ---- 彩虹勋章 ---- */
.badge-rainbow .badge-inner {
    background: conic-gradient(from 0deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000);
    box-shadow: 0 3px 18px rgba(148, 0, 211, 0.5);
    animation: rainbow-spin 4s linear infinite;
}
.badge-rainbow .badge-ribbon { background: conic-gradient(from 90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000); }
.badge-rainbow .badge-glow { background: radial-gradient(circle, rgba(148,0,211,0.2) 0%, transparent 70%); }
@keyframes rainbow-spin {
    0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); }
}

/* ---- 军衔勋章 ---- */
.badge-military .badge-inner {
    background: linear-gradient(145deg, #2F4F4F, #556B2F, #2F4F4F);
    box-shadow: 0 3px 12px rgba(47, 79, 79, 0.7), inset 0 1px 2px rgba(255,255,255,0.2);
    border: 2px solid #DAA520;
}
.badge-military::after {
    content: '★';
    position: absolute;
    top: 4px; right: 4px;
    font-size: 10px;
    color: #DAA520;
    z-index: 3;
}
.badge-military .badge-ribbon { background: linear-gradient(180deg, #8B4513, #5D3A1A); }
.badge-military .badge-glow { background: radial-gradient(circle, rgba(218,165,32,0.2) 0%, transparent 70%); }

/* ---- 月亮勋章 ---- */
.badge-moon .badge-inner {
    background: linear-gradient(145deg, #2c3e50, #34495e, #1a252f);
    box-shadow: 0 3px 16px rgba(44, 62, 80, 0.8);
}
.badge-moon::before {
    content: '☽';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -55%);
    font-size: 20px;
    color: #F5F5DC;
    z-index: 3;
}
.badge-moon .badge-ribbon { background: linear-gradient(180deg, #191970, #000033); }
.badge-moon .badge-glow { background: radial-gradient(circle, rgba(245,245,220,0.15) 0%, transparent 70%); animation: moon-glow 3s ease-in-out infinite; }
@keyframes moon-glow {
    0%, 100% { opacity: 0.3; } 50% { opacity: 0.7; }
}

/* ===== 暗黑模式适配 ===== */
[data-theme="dark"] .badge-gold .badge-inner { box-shadow: 0 3px 18px rgba(255,215,0,0.9); }
[data-theme="dark"] .badge-silver .badge-inner { box-shadow: 0 3px 18px rgba(200,200,200,0.8); }
[data-theme="dark"] .badge-bronze .badge-inner { box-shadow: 0 3px 18px rgba(184,115,51,0.9); }
[data-theme="dark"] .badge-crown .badge-inner { box-shadow: 0 3px 24px rgba(255,215,0,1); }
[data-theme="dark"] .badge-star .badge-inner { box-shadow: 0 3px 22px rgba(102,126,234,1); }
[data-theme="dark"] .badge-heart .badge-inner { box-shadow: 0 3px 22px rgba(255,20,147,0.9); }
[data-theme="dark"] .badge-lightning .badge-inner { box-shadow: 0 3px 22px rgba(244,196,48,1); }
[data-theme="dark"] .badge-diamond .badge-inner { box-shadow: 0 3px 24px rgba(0,191,255,0.9); }
[data-theme="dark"] .badge-fire .badge-inner { box-shadow: 0 3px 24px rgba(255,69,0,1); }
[data-theme="dark"] .badge-ice .badge-inner { box-shadow: 0 3px 22px rgba(0,188,212,0.9); }
[data-theme="dark"] .badge-military .badge-inner { box-shadow: 0 3px 18px rgba(47,79,79,1); }
[data-theme="dark"] .badge-moon .badge-inner { box-shadow: 0 3px 22px rgba(44,62,80,1); }
