/* 全局弹窗挂载容器 */
#global-modal-root {
    position: fixed;
    inset: 0;
    z-index: 2000;
    pointer-events: none;
}

#global-modal-root .modal {
    pointer-events: auto;
}

/* 其余模态框样式保持不变 */

/* 模态框头部 */
.modal-header {
    background: linear-gradient(135deg, #f5f7ff 0%, #eef1ff 100%);
    border-bottom: 1px solid #eaeaea;
    padding: 20px 24px;
}

[data-theme="dark"] .modal-header {
    background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
    border-bottom: 1px solid #444;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

[data-theme="dark"] .modal-title {
    color: #e9ecef;
}

/* 模态框关闭按钮 */
.modal-header .btn-close {
    padding: 0.5rem;
    margin: -0.5rem -0.5rem -0.5rem auto;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #6c757d;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.modal-header .btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

[data-theme="dark"] .modal-header .btn-close {
    color: #adb5bd;
}

/* 模态框主体 */
.modal-body {
    padding: 24px;
    background: #ffffff;
}

[data-theme="dark"] .modal-body {
    background: #2d2d2d;
    color: #e9ecef;
}

/* 模态框底部 */
.modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #eaeaea;
    padding: 16px 24px;
}

[data-theme="dark"] .modal-footer {
    background: #333333;
    border-top: 1px solid #444;
}

/* 模态框按钮样式 */
.modal-footer .btn {
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.modal-footer .btn-primary {
    background: #4361ee;
    border: 1px solid #4361ee;
    color: white;
}

.modal-footer .btn-primary:hover {
    background: #3a56d4;
    border-color: #3a56d4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(67, 97, 238, 0.3);
}

.modal-footer .btn-secondary {
    background: #6c757d;
    border: 1px solid #6c757d;
    color: white;
}

.modal-footer .btn-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.modal-footer .btn-danger {
    background: #dc3545;
    border: 1px solid #dc3545;
    color: white;
}

.modal-footer .btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.modal-footer .btn-success {
    background: #28a745;
    border: 1px solid #28a745;
    color: white;
}

.modal-footer .btn-success:hover {
    background: #218838;
    border-color: #1e7e34;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* 模态框尺寸 */
.modal-dialog {
    max-width: 600px;
    margin: 1.75rem auto;
}

.modal-dialog.modal-sm {
    max-width: 400px;
}

.modal-dialog.modal-lg {
    max-width: 800px;
}

.modal-dialog.modal-xl {
    max-width: 1140px;
}

/* 响应式模态框 */
@media (max-width: 768px) {
    .modal-dialog {
        max-width: calc(100% - 2rem);
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
    
    .modal-title {
        font-size: 1.125rem;
    }
    
    .modal-footer .btn {
        padding: 6px 12px;
        font-size: 0.875rem;
        margin-left: 6px;
    }
}

@media (max-width: 576px) {
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        margin: 4px 0;
        width: 100%;
    }
    
    .modal-dialog.modal-xl {
        max-width: calc(100% - 1rem);
        margin: 0.5rem;
    }
}

/* 模态框动画效果 */
.modal.fade .modal-dialog {
    transform: translate(0, -50px);
    transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
    transform: none;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

/* 模态框表单样式 */
.modal-body .form-control,
.modal-body .form-select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 10px 12px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.25);
}

[data-theme="dark"] .modal-body .form-control,
[data-theme="dark"] .modal-body .form-select {
    background: #3a3a3a;
    border-color: #444;
    color: #e9ecef;
}

[data-theme="dark"] .modal-body .form-control:focus,
[data-theme="dark"] .modal-body .form-select:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.25);
}

.modal-body .form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 6px;
}

[data-theme="dark"] .modal-body .form-label {
    color: #adb5bd;
}

/* 模态框输入组样式 */
.modal-body .input-group {
    border-radius: 8px;
    overflow: hidden;
}

.modal-body .input-group-text {
    background: #f8f9fa;
    border: 1px solid #ced4da;
    color: #495057;
    font-weight: 500;
}

[data-theme="dark"] .modal-body .input-group-text {
    background: #3a3a3a;
    border-color: #444;
    color: #adb5bd;
}

/* 模态框文本区域样式 */
.modal-body textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* 模态框卡片样式 */
.modal-body .card {
    border-radius: 8px;
    border: 1px solid #eaeaea;
    box-shadow: none;
    margin-bottom: 16px;
}

[data-theme="dark"] .modal-body .card {
    border-color: #444;
    background: #333333;
}

.modal-body .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
    padding: 12px 16px;
    font-weight: 500;
}

[data-theme="dark"] .modal-body .card-header {
    background: #3a3a3a;
    border-bottom: 1px solid #444;
    color: #e9ecef;
}