/* ---------- iOS灵动岛样式 ---------- */
.dynamic-island {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10050;
    pointer-events: none;
    display: none;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.dynamic-island.show {
    display: block;
    opacity: 1;
}

.dynamic-island-content {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(20, 20, 20, 0.9) 100%);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 24px;
    padding: 14px 24px;
    min-width: 200px;
    max-width: 320px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: islandExpand 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.dynamic-island-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmer 2s infinite;
}

.dynamic-island.hide .dynamic-island-content {
    animation: islandCollapse 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

@keyframes islandExpand {
    0% {
        transform: scaleX(0.3) scaleY(0.3);
        opacity: 0;
        filter: blur(10px);
    }
    40% {
        transform: scaleX(1.08) scaleY(1.08);
        opacity: 0.8;
        filter: blur(2px);
    }
    60% {
        transform: scaleX(0.98) scaleY(0.98);
        opacity: 1;
        filter: blur(0);
    }
    80% {
        transform: scaleX(1.02) scaleY(1.02);
    }
    100% {
        transform: scaleX(1) scaleY(1);
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes islandCollapse {
    0% {
        transform: scaleX(1) scaleY(1);
        opacity: 1;
        filter: blur(0);
    }
    100% {
        transform: scaleX(0.3) scaleY(0.3);
        opacity: 0;
        filter: blur(10px);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.island-message {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
}

.island-icon {
    font-size: 18px;
    flex-shrink: 0;
    animation: iconBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes iconBounce {
    0% {
        transform: scale(0) rotate(-180deg);
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.dynamic-island.success .island-icon {
    color: #4CAF50;
    text-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
    animation: successPulse 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dynamic-island.error .island-icon {
    color: #f44336;
    text-shadow: 0 0 20px rgba(244, 67, 54, 0.6);
    animation: errorShake 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPulse {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(10deg);
        opacity: 1;
    }
    70% {
        transform: scale(0.9) rotate(-5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes errorShake {
    0% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
    30% {
        transform: scale(1.2) rotate(-15deg);
        opacity: 1;
    }
    50% {
        transform: scale(0.9) rotate(10deg);
    }
    70% {
        transform: scale(1.1) rotate(-5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.dynamic-island.success .dynamic-island-content {
    border-color: rgba(76, 175, 80, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(76, 175, 80, 0.2),
        0 4px 16px rgba(76, 175, 80, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dynamic-island.error .dynamic-island-content {
    border-color: rgba(244, 67, 54, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(244, 67, 54, 0.2),
        0 4px 16px rgba(244, 67, 54, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
