/* Toast 组件样式 - 可复用到各页面 */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
    pointer-events: auto;
    max-width: 380px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.toast.error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.toast.warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.toast.info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-close {
    margin-left: auto;
    padding: 4px;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

/* Loading 遮罩层样式 */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    backdrop-filter: blur(4px);
}

.loading-overlay.active {
    display: flex;
}

.loading-box {
    text-align: center;
    padding: 32px 48px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: #6b7280;
    font-size: 15px;
}

/* 空状态样式增强 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    color: #9ca3af;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state .empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 8px;
}

.empty-state .empty-desc {
    font-size: 14px;
    color: #9ca3af;
    max-width: 320px;
    line-height: 1.7;
}

.empty-state .empty-action {
    margin-top: 20px;
}

/* 表单错误状态 */
.field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.field-success {
    border-color: #10b981 !important;
}

.field-message {
    display: none;
    font-size: 12px;
    color: #ef4444;
    margin-top: 6px;
    padding-left: 2px;
}

.field-message.show {
    display: block;
}

/* 按钮禁用态 */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn.slim.btn-loading::after {
    width: 14px;
    height: 14px;
}

/* Focus 可见性增强 */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 键盘操作优化 - 高对比度 focus */
.nav-button:focus-visible,
.tree-button:focus-visible,
.icon-button:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
}