/* 
 * 统一 Z-Index 层级管理系统
 * 解决消息弹窗层级冲突问题
 * 
 * 层级规划：
 * 0-99: 基础元素 (卡片、按钮等)
 * 100-999: 导航和菜单
 * 1000-9999: 普通弹窗和遮罩
 * 10000-99999: 重要弹窗和通知
 * 100000+: 最高优先级弹窗 (错误、确认等)
 */

/* === 基础层级 (0-99) === */
.z-base { z-index: 1; }
.z-card { z-index: 2; }
.z-card-hover { z-index: 6; }
.z-button { z-index: 10; }

/* === 导航层级 (100-999) === */
.z-nav { z-index: 100; }
.z-nav-menu { z-index: 101; }
.z-nav-submenu { z-index: 102; }
.z-dropdown { z-index: 200; }

/* === 普通弹窗层级 (1000-9999) === */
.z-modal-base { z-index: 1000; }
.z-modal-overlay { z-index: 1001; }
.z-tooltip { z-index: 2000; }
.z-popover { z-index: 3000; }

/* === 重要弹窗层级 (10000-99999) === */
.z-notification { z-index: 10000; }
.z-message-popup { z-index: 15000; }
.z-auth-modal { z-index: 25000; }
.z-mobile-mask { z-index: 25000; }

/* === 最高优先级层级 (100000+) === */
.z-error-modal { z-index: 100000; }
.z-success-modal { z-index: 100001; }
.z-confirm-modal { z-index: 100002; }
.z-loading-modal { z-index: 100003; }

/* === 动态层级支持 === */
.z-dynamic-base { z-index: 50000; }
.z-dynamic-increment { z-index: 50001; }

/* 现有样式的覆盖 - 确保使用新的层级系统 */
.auth-modal { 
    z-index: 25000 !important; 
    /* 垂直居中显示弹窗，移除偏移 */
    align-items: center !important;
    padding-top: 0 !important;
}
.mobile-mask { z-index: 25000 !important; }
.message-notification { z-index: 15000 !important; }

/* 按钮层级控制 - 确保弹窗能够覆盖按钮 */
.user-btn { z-index: 100 !important; }
.user-btn.secondary { z-index: 100 !important; }
.msg-reply-btn { z-index: 100 !important; }
.msg-delete-btn { z-index: 100 !important; }
.error-modal-overlay { z-index: 100000 !important; }
.success-modal-overlay { z-index: 100001 !important; }
.delete-modal-overlay { z-index: 100002 !important; }

/* 确保动态弹窗始终在最上层 */
.modal-z-index-dynamic {
    z-index: 50000 !important;
}

.modal-z-index-dynamic[data-dynamic-z-index] {
    z-index: attr(data-dynamic-z-index number, 50000) !important;
}