/* ========================================
   状态栏样式 - 血条、护盾、状态徽章
   ======================================== */

.status-bar {
    background: linear-gradient(135deg, rgba(20, 24, 30, 0.8) 0%, rgba(30, 35, 45, 0.6) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 12px 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    min-height: 78px;
}

.status-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.npc-bar {
    border-top: 3px solid var(--enemy-color);
    box-shadow:
        0 4px 20px rgba(255, 46, 77, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.npc-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(180deg, rgba(255, 46, 77, 0.08) 0%, transparent 100%);
    pointer-events: none;
}

.player-bar {
    border-top: 3px solid var(--primary-color);
    box-shadow:
        0 4px 20px rgba(0, 242, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.player-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(180deg, rgba(0, 242, 255, 0.08) 0%, transparent 100%);
    pointer-events: none;
}

.bar-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.role-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.npc-bar .role-name {
    color: var(--enemy-color);
}

.player-bar .role-name {
    color: var(--primary-color);
}

.stats-values {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    display: flex;
    gap: 10px;
    align-items: center;
}

.hp-val {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hp-val::before {
    content: '❤';
    color: var(--hp-color);
    font-size: 0.85rem;
    filter: drop-shadow(0 0 3px rgba(231, 76, 60, 0.5));
}

.shield-val {
    color: #7fb3d5;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.shield-val::before {
    content: '🛡';
    font-size: 0.8rem;
    filter: drop-shadow(0 0 3px rgba(52, 152, 219, 0.5));
}

.progress-track {
    width: 100%;
    height: 12px;
    background: linear-gradient(180deg, #0a0c10 0%, #1a1e26 50%, #0a0c10 100%);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.8),
        inset 0 -1px 2px rgba(255, 255, 255, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 3px;
}

.shield-track {
    width: 100%;
    height: 6px;
    position: relative;
    margin-top: 3px;
    transition: opacity 0.3s ease;
}

.shield-track.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 伤害延迟显示条（半透明浅红色，通过透明度与血条区分） */
.hp-damage-fill {
    height: 100%;
    background: linear-gradient(180deg,
            rgba(255, 150, 150, 0.6) 0%,
            rgba(231, 120, 120, 0.5) 30%,
            rgba(200, 100, 100, 0.5) 70%,
            rgba(180, 80, 80, 0.4) 100%);
    position: absolute;
    top: 0;
    left: 0;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-out;
    z-index: 2;
    border-radius: 6px 0 0 6px;
}

/* 伤害延迟条为0时隐藏 */
.hp-damage-fill[style*="width: 0%"],
.hp-damage-fill[style*="width:0%"] {
    opacity: 0;
}

.hp-fill {
    height: 100%;
    background: linear-gradient(180deg,
            #ff6b6b 0%,
            #e74c3c 30%,
            #c0392b 70%,
            #a93226 100%);
    position: absolute;
    top: 0;
    left: 0;
    transition: width 0.05s ease-out, opacity 0.2s ease-out;
    z-index: 3;
    border-radius: 6px 0 0 6px;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.15),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2),
        0 0 8px rgba(231, 76, 60, 0.3);
}

/* 血条为0时隐藏，避免box-shadow残留 */
.hp-fill[style*="width: 0%"],
.hp-fill[style*="width:0%"] {
    opacity: 0;
}

.shield-fill {
    height: 100%;
    background: linear-gradient(135deg,
            #b8c0c8 0%,
            #9ca4ac 25%,
            #808890 50%,
            #9ca4ac 75%,
            #b8c0c8 100%);
    background-size: 200% 100%;
    position: absolute;
    top: 0;
    left: 0;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    border-radius: 3px;
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.4),
        inset 0 -1px 1px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(150, 160, 170, 0.4);
    overflow: hidden;
    animation: shield-shine 3s linear infinite;
}

.shield-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.5) 50%,
            transparent 100%);
    transform: skewX(-20deg);
    animation: shield-glint 4s ease-in-out infinite;
}

@keyframes shield-shine {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 200% 0%;
    }
}

@keyframes shield-glint {
    0%, 100% {
        left: -50%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    20%, 80% {
        left: 120%;
        opacity: 0;
    }
}

/* 护盾破碎动画 */
.shield-fill.shield-break {
    animation: shield-shatter 0.5s ease-out forwards;
}

@keyframes shield-shatter {
    0% {
        opacity: 1;
        transform: scaleY(1) scaleX(1);
        filter: brightness(1);
    }
    20% {
        opacity: 1;
        transform: scaleY(1.3) scaleX(1.05);
        filter: brightness(1.5);
    }
    40% {
        opacity: 0.8;
        transform: scaleY(0.8) scaleX(1.1);
        filter: brightness(1.2) blur(1px);
    }
    70% {
        opacity: 0.4;
        transform: scaleY(0.5) scaleX(1.15);
        filter: brightness(0.8) blur(3px);
    }
    100% {
        opacity: 0;
        transform: scaleY(0.2) scaleX(1.2);
        filter: brightness(0.5) blur(5px);
    }
}

.status-badges {
    display: flex;
    gap: 6px;
    align-items: center;
}

.badge {
    font-family: 'Orbitron', sans-serif;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.badge.stun {
    background: linear-gradient(135deg, #5dade2 0%, #3498db 50%, #2980b9 100%);
    color: #fff;
    box-shadow:
        0 2px 8px rgba(52, 152, 219, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: badge-stun-glow 1.5s ease-in-out infinite;
}

@keyframes badge-stun-glow {

    0%,
    100% {
        box-shadow:
            0 2px 8px rgba(52, 152, 219, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }

    50% {
        box-shadow:
            0 2px 15px rgba(52, 152, 219, 0.7),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}
