:root {
    --macos-ease-standard: cubic-bezier(0.4, 0.0, 0.2, 1);
    --macos-ease-decelerate: cubic-bezier(0.0, 0.0, 0.2, 1);
    --macos-ease-accelerate: cubic-bezier(0.4, 0.0, 1.0, 1.0);
    --macos-ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
    --macos-ease-smooth: cubic-bezier(0.32, 0.72, 0, 1);

    --duration-instant: 0.1s;
    --duration-fast: 0.3s;
    --duration-normal: 0.6s;
    --duration-slow: 1.0s;
    --duration-slower: 1.2s;
    --duration-slowest: 1.5s;

    --will-change-transform: transform;
    --will-change-opacity: opacity;
    --gpu-accelerated: translateZ(0);
}

@keyframes bootFadeIn {
    0% { opacity: 0; transform: scale(0.96) translateY(10px); filter: blur(2px); }
    100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}
@keyframes logoPulse {
    0%, 100% { opacity: 0.85; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}
@keyframes progressShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes menuBarSlideDown {
    0% { opacity: 0; transform: translateY(-100%); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes submenuReveal {
    0% { opacity: 0; transform: scale(0.96) translateY(-8px); filter: blur(4px); }
    100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

@keyframes dockSlideUp {
    0% { opacity: 0; transform: translateY(100%) scaleY(0.9); }
    100% { opacity: 1; transform: translateY(0) scaleY(1); }
}
@keyframes dockItemPop {
    0% { opacity: 0; transform: scale(0.7) translateY(20px); filter: blur(6px); }
    100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

@keyframes dockBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}
@keyframes badgeAppear {
    0% { opacity: 0; transform: scale(0); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes windowOpen {
    0% { opacity: 0; transform: scale(0.88) translateY(40px); filter: blur(12px); }
    100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}
@keyframes windowClose {
    0% { opacity: 1; transform: scale(1); filter: blur(0); }
    100% { opacity: 0; transform: scale(0.85); filter: blur(12px); }
}
/* 最小化/恢复：无 skew，无 clip-path，纯平滑缩放位移 */
@keyframes windowMinimizeGenie {
    0% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
    100% { opacity: 0; transform: scale(0.05) translateY(150px); filter: blur(12px); }
}
@keyframes windowRestoreFromDock {
    0% { opacity: 0; transform: scale(0.05) translateY(150px); filter: blur(12px); }
    100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}
@keyframes windowFullscreen {
    0% { opacity: 0.9; transform: scale(0.95); border-radius: 12px; }
    100% { opacity: 1; transform: scale(1); border-radius: 0; }
}
@keyframes windowExitFullscreen {
    0% { opacity: 0.9; transform: scale(1.02); border-radius: 0; }
    100% { opacity: 1; transform: scale(1); border-radius: 12px; }
}
@keyframes windowFocusPulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
    50% { box-shadow: 0 16px 48px rgba(0,0,0,0.2); }
}

@keyframes iconFadeInStagger {
    0% { opacity: 0; transform: translateY(20px) scale(0.9); filter: blur(4px); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes iconSelect {
    0% { transform: scale(1); }
    50% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

@keyframes contextMenuAppear {
    0% { opacity: 0; transform: scale(0.92) translateY(-10px); filter: blur(8px); }
    100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

@keyframes controlCenterSlide {
    0% { opacity: 0; transform: translateY(-20px) scale(0.95); filter: blur(12px); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes moduleStagger {
    0% { opacity: 0; transform: translateX(-15px) scale(0.96); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes siriOrbPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.08); opacity: 1; }
}
@keyframes siriInterfaceReveal {
    0% { opacity: 0; transform: scale(0.9) translateY(30px); backdrop-filter: blur(0); }
    100% { opacity: 1; transform: scale(1) translateY(0); backdrop-filter: blur(20px); }
}

@keyframes dragLift {
    0% { transform: scale(1); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
    100% { transform: scale(1.02); box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
}
@keyframes resizeIndicator {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.anim-boot-fade-in { animation: bootFadeIn 1.5s var(--macos-ease-decelerate) forwards; }
.anim-logo-pulse { animation: logoPulse 2s ease-in-out infinite; }
.anim-menu-bar-slide { animation: menuBarSlideDown 1.0s var(--macos-ease-decelerate) forwards; }
.anim-submenu-reveal { animation: submenuReveal 0.8s var(--macos-ease-smooth) forwards; }
.anim-dock-slide-up { animation: dockSlideUp 1.2s var(--macos-ease-smooth) 0.3s backwards; }
.anim-dock-item-pop { animation: dockItemPop 1.0s var(--macos-ease-smooth) backwards; }
.anim-dock-bounce { animation: dockBounce 0.6s var(--macos-ease-smooth); }
.anim-badge-appear { animation: badgeAppear 0.8s var(--macos-ease-smooth) forwards; }

.anim-window-open { animation: windowOpen 1.2s var(--macos-ease-decelerate) forwards; }
.anim-window-close { animation: windowClose 1.0s var(--macos-ease-accelerate) forwards; }
.anim-window-minimize { animation: windowMinimizeGenie 1.2s var(--macos-ease-accelerate) forwards; }
.anim-window-restore { animation: windowRestoreFromDock 1.2s var(--macos-ease-decelerate) forwards; }
.anim-window-fullscreen { animation: windowFullscreen 1.0s var(--macos-ease-standard) forwards; }
.anim-window-exit-fullscreen { animation: windowExitFullscreen 1.0s var(--macos-ease-standard) forwards; }
.anim-window-focus { animation: windowFocusPulse 1.5s var(--macos-ease-smooth); }

.anim-icon-fade-in { animation: iconFadeInStagger 1.0s var(--macos-ease-decelerate) backwards; }
.anim-icon-select { animation: iconSelect 0.8s var(--macos-ease-smooth); }
.anim-context-menu { animation: contextMenuAppear 0.8s var(--macos-ease-smooth) forwards; }
.anim-control-center { animation: controlCenterSlide 1.0s var(--macos-ease-smooth) forwards; }
.anim-module-stagger { animation: moduleStagger 0.8s var(--macos-ease-decelerate) backwards; }
.anim-siri-orb { animation: siriOrbPulse 3s ease-in-out infinite; }
.anim-siri-reveal { animation: siriInterfaceReveal 1.2s var(--macos-ease-smooth) forwards; }
.anim-drag-lift { animation: dragLift 0.6s var(--macos-ease-smooth) forwards; }

.transition-stable {
    transition: all 1.2s var(--macos-ease-smooth);
    will-change: transform, opacity;
}
.transition-window {
    transition: transform 1.2s var(--macos-ease-smooth),
                opacity 0.8s var(--macos-ease-smooth),
                width 1.0s var(--macos-ease-standard),
                height 1.0s var(--macos-ease-standard),
                left 1.0s var(--macos-ease-standard),
                top 1.0s var(--macos-ease-standard);
    will-change: transform, opacity, width, height, left, top;
}
.transition-minimize {
    transition: all 1.2s var(--macos-ease-accelerate);
    will-change: transform, opacity;
}
.transition-dock {
    transition: transform 0.6s var(--macos-ease-smooth),
                opacity 0.4s var(--macos-ease-smooth);
    will-change: transform, opacity;
}
.transition-menu {
    transition: opacity 0.6s var(--macos-ease-smooth),
                transform 0.6s var(--macos-ease-smooth);
    will-change: opacity, transform;
}

.window-animating { pointer-events: none !important; user-select: none !important; }
.window-animating iframe { pointer-events: none !important; }
.window-dragging { cursor: grabbing !important; transition: none !important; will-change: left, top; z-index: 99999 !important; }
.window-resizing { cursor: inherit !important; transition: none !important; will-change: width, height, left, top; z-index: 99999 !important; }
.window-minimizing { pointer-events: none; transition: all 1.2s var(--macos-ease-accelerate); transform-origin: center bottom; }
.window-restoring { pointer-events: none; transition: all 1.2s var(--macos-ease-decelerate); transform-origin: center bottom; }
.window-stable { transition: box-shadow 0.3s var(--macos-ease-smooth); }

.gpu-accelerated { transform: translateZ(0); backface-visibility: hidden; perspective: 1000px; }
.contain-layout { contain: layout style paint; }
.will-change-transform { will-change: transform; }
.will-change-opacity { will-change: opacity; }

/* @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
} */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .window, .dock-panel, .menu-bar { transform: translateZ(0); }
}