@layer utilities {
    .content-auto {
        content-visibility: auto;
    }
    .card-hover {
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    .card-hover:hover {
        transform: translateY(-12px) scale(1.02);
        box-shadow: 0 25px 50px -12px rgba(59, 130, 246, 0.25);
    }
    .glass {
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.12);
    }
    .glass-dark {
        background: rgba(15, 23, 42, 0.85);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
    .bg-tech {
        background: radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.18) 0%, transparent 50%),
                    radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.12) 0%, transparent 50%),
                    radial-gradient(circle at 40% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
                    #0F172A;
    }
    .btn-breath {
        animation: breath 3s ease-in-out infinite;
    }
    @keyframes breath {
        0%, 100% {
            box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
            transform: scale(1);
        }
        50% {
            box-shadow: 0 0 50px rgba(59, 130, 246, 0.9);
            transform: scale(1.06);
        }
    }
    .text-gradient {
        background: linear-gradient(90deg, #3B82F6, #10B981, #A855F7);
        background-size: 200% auto;
        animation: textGradient 5s ease infinite;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    @keyframes textGradient {
        0% { background-position: 0% center; }
        50% { background-position: 100% center; }
        100% { background-position: 0% center; }
    }
    .animate-float {
        animation: float 6s ease-in-out infinite;
    }
    @keyframes float {
        0%, 100% {
            transform: translateY(0px);
        }
        50% {
            transform: translateY(-15px);
        }
    }
    .animate-float-slow {
        animation: floatSlow 8s ease-in-out infinite;
    }
    @keyframes floatSlow {
        0%, 100% {
            transform: translateY(0px) rotate(0deg);
        }
        50% {
            transform: translateY(-20px) rotate(5deg);
        }
    }
    .particle {
        position: absolute;
        border-radius: 50%;
        pointer-events: none;
    }
    .skill-pulse {
        animation: skillPulse 2s ease-in-out infinite;
    }
    @keyframes skillPulse {
        0%, 100% {
            box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
        }
        50% {
            box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
        }
    }
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: all 0.6s ease;
    }
    .reveal.active {
        opacity: 1;
        transform: translateY(0);
    }
    .avatar-3d {
        transform-style: preserve-3d;
        transition: transform 0.6s ease;
    }
    .avatar-3d:hover {
        transform: rotateY(15deg) rotateX(5deg);
    }
    .typing-cursor {
        animation: blink 1s infinite;
    }
    @keyframes blink {
        0%, 50% { opacity: 1; }
        51%, 100% { opacity: 0; }
    }
    .progress-bar {
        height: 6px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
        overflow: hidden;
    }
    .progress-fill {
        height: 100%;
        border-radius: 3px;
        transition: width 1.5s ease-in-out;
    }
    .scroll-progress {
        position: fixed;
        top: 0;
        left: 0;
        height: 3px;
        background: linear-gradient(90deg, #3B82F6, #10B981, #A855F7);
        z-index: 9999;
        transition: width 0.1s;
    }
    .back-to-top {
        position: fixed;
        bottom: 30px;
        right: 30px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: linear-gradient(135deg, #3B82F6, #10B981);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        cursor: pointer;
        opacity: 0;
        visibility: hidden;
        transform: translateY(20px);
        transition: all 0.3s ease;
        z-index: 9998;
        box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
    }
    .back-to-top.visible {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    .back-to-top:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 40px rgba(59, 130, 246, 0.6);
    }
    
    /* 代码编辑器移动设备优化 */
    @media (max-width: 640px) {
        .code-editor-container pre {
            height: 48vh;
            font-size: 0.875rem;
        }
        
        .code-editor-container textarea {
            font-size: 0.875rem;
        }
        
        .practice-header {
            padding: 1rem;
        }
        
        .practice-header h3 {
            font-size: 1.125rem;
        }
        
        .problem-list {
            grid-template-columns: repeat(3, 1fr);
        }
    }
    
    @media (max-width: 480px) {
        .code-editor-container pre {
            height: 40vh;
        }
        
        .code-editor-container textarea {
            font-size: 0.75rem;
        }
    }
    
    /* 按钮组移动设备优化 */
    @media (max-width: 640px) {
        .flex-wrap.gap-4 {
            flex-direction: column;
        }
        
        .flex-wrap.gap-4 > div {
            width: 100%;
        }
        
        .flex-wrap.gap-4 button {
            flex: 1;
            justify-content: center;
        }
        
        .flex-wrap.gap-4 .flex {
            margin-top: 0.5rem;
        }
    }
    .cursor-follower {
        position: fixed;
        width: 20px;
        height: 20px;
        border: 2px solid rgba(59, 130, 246, 0.6);
        border-radius: 50%;
        pointer-events: none;
        z-index: 9999;
        transition: transform 0.15s ease, width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
        transform: translate(-50%, -50%);
    }
    .cursor-follower.active {
        width: 50px;
        height: 50px;
        border-color: rgba(16, 185, 129, 0.8);
    }
    .btn-shine {
        position: relative;
        overflow: hidden;
    }
    .btn-shine::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.5s;
    }
    .btn-shine:hover::before {
        left: 100%;
    }
    .star {
        position: absolute;
        background: white;
        border-radius: 50%;
        animation: twinkle 3s ease-in-out infinite;
    }
    @keyframes twinkle {
        0%, 100% { opacity: 0.3; }
        50% { opacity: 1; }
    }
    .knowledge-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease-out, padding 0.3s ease;
    }
    .knowledge-content.expanded {
        max-height: 2000px;
        padding-top: 1rem;
    }
    .expand-btn {
        transition: transform 0.3s ease;
    }
    .expand-btn.rotated {
        transform: rotate(180deg);
    }
    .breadcrumb {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 2rem;
    }
    .breadcrumb-item {
        color: #94a3b8;
    }
    .breadcrumb-separator {
        color: #64748b;
    }
    .breadcrumb-active {
        color: #f8fafc;
    }
    .modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    .modal.active {
        opacity: 1;
        visibility: visible;
    }
    .modal-content {
        background: #1e293b;
        border-radius: 12px;
        padding: 2rem;
        max-width: 500px;
        width: 90%;
        transform: translateY(20px);
        transition: transform 0.3s ease;
    }
    .modal.active .modal-content {
        transform: translateY(0);
    }
    .mobile-menu {
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100vh;
        background: #0f172a;
        z-index: 9999;
        transition: right 0.3s ease;
        padding: 2rem;
    }
    .mobile-menu.active {
        right: 0;
    }
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* 响应式优化 */
    @media (max-width: 640px) {
        .card-hover:hover {
            transform: translateY(-8px) scale(1.02);
        }
        
        .skill-pulse {
            font-size: 0.875rem;
            padding: 0.5rem 1.5rem;
        }
        
        .prose p {
            font-size: 1rem !important;
        }
        
        .modal-content {
            padding: 1.5rem;
        }
        
        .glass {
            padding: 1.5rem;
        }
        
        h1 {
            font-size: 2.5rem !important;
        }
        
        h2 {
            font-size: 2rem !important;
        }
        
        h3 {
            font-size: 1.5rem !important;
        }
        
        .hero-stats {
            grid-template-columns: repeat(2, 1fr);
        }
        
        .btn-shine {
            padding: 0.75rem 1.5rem;
            font-size: 0.875rem;
        }
        
        .btn-breath a {
            padding: 0.75rem 2rem;
            font-size: 0.875rem;
        }
    }
    
    @media (max-width: 480px) {
        .container {
            padding-left: 1rem;
            padding-right: 1rem;
        }
        
        .hero-stats {
            grid-template-columns: 1fr;
            gap: 1rem;
        }
        
        .skill-pulse {
            font-size: 0.75rem;
            padding: 0.5rem 1rem;
        }
        
        h1 {
            font-size: 2rem !important;
        }
        
        h2 {
            font-size: 1.5rem !important;
        }
        
        .btn-shine {
            width: 100%;
            justify-content: center;
        }
    }
}
