/* CBModal - NextGen 3D Design */
.cb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 10, 0.7); /* 更深的背景 */
    backdrop-filter: blur(20px); /* 20px 高斯模糊 */
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cb-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cb-modal-card {
    background: rgba(24, 24, 27, 0.85); /* 深色玻璃基底 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2); /* 顶部高光 */
    border-radius: 24px;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    width: 90%;
    max-width: 400px;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    transform: scale(0.8) translateY(50px);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); /* Spring 弹簧效果 */
    color: #f4f4f5;
    position: relative;
    overflow: visible; /* 允许图标悬浮溢出 */
}

.cb-modal-overlay.active .cb-modal-card {
    transform: scale(1) translateY(0);
}

/* 3D Visual Anchor Icons */
.cb-modal-icon-wrapper {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    perspective: 1000px;
}

.cb-modal-icon-3d {
    font-size: 36px;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transform-style: preserve-3d;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotateX(10deg); }
    50% { transform: translateY(-10px) rotateX(-10deg); }
}

/* Icon Variants */
/* Danger: Neo Red - 3D Trash/Warning */
.cb-modal-icon-3d.danger {
    background: linear-gradient(135deg, #ff1744, #b91c1c);
    color: white;
    box-shadow: 
        0 10px 30px rgba(255, 23, 68, 0.4),
        inset 0 2px 10px rgba(255,255,255,0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Success: Lime Green - 3D Check */
.cb-modal-icon-3d.success {
    background: linear-gradient(135deg, #4ade80, #16a34a);
    color: #052e16;
    box-shadow: 
        0 10px 30px rgba(74, 222, 128, 0.4),
        inset 0 2px 10px rgba(255,255,255,0.4);
}

/* Info/Primary: Electric Blue/Violet */
.cb-modal-icon-3d.primary, .cb-modal-icon-3d.info {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    box-shadow: 
        0 10px 30px rgba(99, 102, 241, 0.4),
        inset 0 2px 10px rgba(255,255,255,0.3);
}

/* Warning: Amber */
.cb-modal-icon-3d.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 
        0 10px 30px rgba(245, 158, 11, 0.4),
        inset 0 2px 10px rgba(255,255,255,0.3);
}

.cb-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f4f4f5;
    margin-top: 2rem; /* 为悬浮图标留出空间 */
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.cb-modal-content {
    font-size: 1rem;
    color: #a1a1aa; /* Text secondary */
    line-height: 1.6;
    margin-bottom: 2rem;
}

.cb-modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Tactile Buttons */
.cb-modal-btn {
    padding: 0.85rem 1.75rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.025em;
    position: relative;
    overflow: hidden;
}

/* Cancel Button: "Step Back" Logic */
.cb-modal-btn-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a1a1aa;
    backdrop-filter: blur(5px);
}

.cb-modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f4f4f5;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Primary/Confirm Button: "Pop Out" Logic */
.cb-modal-btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: white;
    box-shadow: 
        0 4px 15px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.cb-modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(99, 102, 241, 0.5),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

.cb-modal-btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

/* Danger Button: Neo Red */
.cb-modal-btn-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    border: none;
    color: white;
    box-shadow: 
        0 4px 15px rgba(239, 68, 68, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.cb-modal-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(239, 68, 68, 0.5),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

/* Success Button: Lime Green */
.cb-modal-btn-success {
    background: linear-gradient(135deg, #22c55e, #15803d);
    border: none;
    color: white;
    box-shadow: 
        0 4px 15px rgba(34, 197, 94, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Shake Animation for Resistance */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake-animation {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

/* Scope Switcher Elements - Dark Mode (Default) */
.scope-switcher-search {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #f4f4f5 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.scope-switcher-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.scope-switcher-search:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.scope-switcher-divider {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Light Mode Adaptations */
[data-bs-theme="light"] .cb-modal-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="light"] .cb-modal-title {
    color: #1a1a1a;
    text-shadow: none;
}

[data-bs-theme="light"] .cb-modal-content {
    color: #555;
}

[data-bs-theme="light"] .cb-modal-btn-cancel {
    color: #555;
    border-color: rgba(0,0,0,0.2);
}

[data-bs-theme="light"] .cb-modal-btn-cancel:hover {
    background: rgba(0,0,0,0.05);
    color: #1a1a1a;
    border-color: rgba(0,0,0,0.3);
}

/* User Scope Switcher Items - Light Mode */
[data-bs-theme="light"] .scope-switcher-item {
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: #333 !important;
}

[data-bs-theme="light"] .scope-switcher-item:hover {
    background: rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05) !important;
}

[data-bs-theme="light"] .scope-switcher-item.bg-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.5) !important;
}

/* Search Input - Light Mode */
[data-bs-theme="light"] .scope-switcher-search {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #333 !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

[data-bs-theme="light"] .scope-switcher-search::placeholder {
    color: rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="light"] .scope-switcher-search:focus {
    background: rgba(0, 0, 0, 0.08) !important;
    color: #000 !important;
    box-shadow: none !important;
}

[data-bs-theme="light"] .scope-switcher-divider {
    border-color: rgba(0, 0, 0, 0.1) !important;
}
