/* 模态框样式 */

/* 模态框深色主题适配 - 不透明背景 */
.modal-content {
    background: #1e293b !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.modal-header {
    border-bottom: 1px solid rgba(99, 102, 241, 0.2) !important;
    background: #1e293b !important;
    padding: 1rem 1.25rem !important;
}

.modal-header .modal-title {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

.modal-header .btn-close {
    filter: invert(1) brightness(0.8) !important;
    opacity: 0.8 !important;
}

.modal-header .btn-close:hover {
    opacity: 1 !important;
}

.modal-body {
    background: #1e293b !important;
    color: var(--text-primary) !important;
    padding: 1.25rem !important;
}

.modal-footer {
    border-top: 1px solid rgba(99, 102, 241, 0.2) !important;
    background: #1e293b !important;
    padding: 1rem 1.25rem !important;
}

/* 模态框内的表单元素 */
.modal-body .form-label {
    color: var(--text-primary) !important;
}

.modal-body .form-control,
.modal-body .form-select {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: var(--text-primary) !important;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: var(--primary) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25) !important;
}

.modal-body .form-control::placeholder {
    color: var(--text-muted) !important;
}

.modal-body .form-text {
    color: var(--text-muted) !important;
}

.modal-body .form-check-label {
    color: var(--text-primary) !important;
}

.modal-body .card {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.modal-body .card-body {
    background: transparent !important;
    color: var(--text-primary) !important;
}

.modal-body .text-danger {
    color: var(--danger, #dc3545) !important;
}

.modal-body .alert-info {
    background: rgba(13, 110, 253, 0.1) !important;
    border-color: rgba(13, 110, 253, 0.3) !important;
    color: var(--text-primary) !important;
}

/* 模态框内的其他元素 */
.modal-body pre,
.modal-body code,
.modal-body #fullPromptPreview {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding: 1rem !important;
    border-radius: var(--radius-md) !important;
}

.modal-body .prompt-preview-content,
.modal-body .bg-light {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: var(--text-primary) !important;
}

.modal-body textarea.form-control,
.modal-body textarea.font-monospace {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: var(--text-primary) !important;
}

.modal-body textarea.form-control:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: var(--primary) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25) !important;
}

.modal-body .text-muted {
    color: var(--text-muted) !important;
}

.modal-body .border {
    border-color: var(--glass-border) !important;
}

.modal-body .form-check-input {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.modal-body .form-check-input:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.modal-body .form-check-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25) !important;
}

/* 模态框内特殊样式的容器 */
.modal-body [style*="background: rgba"],
.modal-body [style*="background-color"] {
    background: rgba(255, 255, 255, 0.08) !important;
}

.modal-body [style*="border-color"] {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* 模态框背景遮罩 */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

/* 用户操作弹窗优化 - 添加动画和样式增强 */
.modal.fade {
    transition: opacity 0.3s ease-in-out;
}

.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: translate(0, 0);
}

/* 用户详情表格样式优化 */
.modal-body .table {
    color: var(--text-primary) !important;
}

.modal-body .table td {
    color: var(--text-primary) !important;
    padding: 0.75rem 0.5rem;
    border-color: rgba(99, 102, 241, 0.2) !important;
}

.modal-body .table .fw-bold {
    color: var(--text-secondary) !important;
    font-weight: 600;
}

.modal-body .table .badge {
    font-size: 0.85em;
    padding: 0.35em 0.65em;
}

/* 模态框内的警告框样式 */
.modal-body .alert {
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.modal-body .alert-danger {
    background: rgba(220, 53, 69, 0.15) !important;
    border-color: rgba(220, 53, 69, 0.3) !important;
    color: var(--danger, #dc3545) !important;
}

.modal-body .alert-success {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: var(--success, #10b981) !important;
}

/* 浅色主题适配 */
[data-theme="light"] .modal-content {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
    color: #1f2937 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .modal-header {
    border-bottom-color: rgba(99, 102, 241, 0.15) !important;
    background: rgba(255, 255, 255, 0.98) !important;
}

[data-theme="light"] .modal-header .modal-title {
    color: #1f2937 !important;
}

[data-theme="light"] .modal-header .btn-close {
    filter: invert(0) !important;
}

[data-theme="light"] .modal-body {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1f2937 !important;
}

[data-theme="light"] .modal-footer {
    border-top-color: rgba(99, 102, 241, 0.15) !important;
    background: rgba(255, 255, 255, 0.98) !important;
}

[data-theme="light"] .modal-body .form-control,
[data-theme="light"] .modal-body .form-select {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
    color: #1f2937 !important;
}

[data-theme="light"] .modal-body .form-control:focus,
[data-theme="light"] .modal-body .form-select:focus {
    background: rgba(255, 255, 255, 1) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15) !important;
}

[data-theme="light"] .modal-body .table td {
    color: #1f2937 !important;
    border-color: rgba(99, 102, 241, 0.1) !important;
}

[data-theme="light"] .modal-body .table .fw-bold {
    color: #4b5563 !important;
}

[data-theme="light"] .modal-body .text-muted {
    color: #6b7280 !important;
}

[data-theme="light"] .modal-body .form-text {
    color: #6b7280 !important;
}

[data-theme="light"] .modal-body .form-label {
    color: #374151 !important;
}

[data-theme="light"] .modal-body .form-check-label {
    color: #1f2937 !important;
}

[data-theme="light"] .modal-body .alert {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
}

[data-theme="light"] .modal-body .alert-danger {
    background: rgba(220, 53, 69, 0.1) !important;
    border-color: rgba(220, 53, 69, 0.3) !important;
    color: #dc3545 !important;
}

[data-theme="light"] .modal-body .alert-success {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #10b981 !important;
}

[data-theme="light"] .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.4) !important;
}

/* 浅色主题 - 模态框卡片样式 */
[data-theme="light"] .modal-body .card {
    background: #ffffff !important;
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .modal-body .card-header {
    background: #f8fafc !important;
    border-bottom: 1px solid rgba(99, 102, 241, 0.15) !important;
    color: #1f2937 !important;
}

[data-theme="light"] .modal-body .card-body {
    background: #ffffff !important;
    color: #1f2937 !important;
}

[data-theme="light"] .modal-body .card-footer {
    background: #f8fafc !important;
    border-top: 1px solid rgba(99, 102, 241, 0.15) !important;
    color: #1f2937 !important;
}

/* 方向管理模态框特殊样式 - form-group 适配 */
.modal-body .form-group {
    margin-bottom: 1.25rem;
}

.modal-body .form-group label {
    color: var(--text-primary) !important;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.modal-body .form-group input[type="text"],
.modal-body .form-group input[type="email"],
.modal-body .form-group textarea {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: var(--text-primary) !important;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.modal-body .form-group input[type="text"]:focus,
.modal-body .form-group input[type="email"]:focus,
.modal-body .form-group textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25) !important;
}

.modal-body .form-group input[type="text"]::placeholder,
.modal-body .form-group input[type="email"]::placeholder,
.modal-body .form-group textarea::placeholder {
    color: var(--text-muted) !important;
}

.modal-body .form-group small.text-muted {
    color: var(--text-muted) !important;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.modal-body .form-group .form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-body .form-group .form-check-input {
    margin-top: 0;
}

.modal-body .form-group .form-check-label {
    color: var(--text-primary) !important;
    margin-bottom: 0;
    cursor: pointer;
}

/* 浅色主题 - form-group 适配 */
[data-theme="light"] .modal-body .form-group label {
    color: #374151 !important;
}

[data-theme="light"] .modal-body .form-group input[type="text"],
[data-theme="light"] .modal-body .form-group input[type="email"],
[data-theme="light"] .modal-body .form-group textarea {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
    color: #1f2937 !important;
}

[data-theme="light"] .modal-body .form-group input[type="text"]:focus,
[data-theme="light"] .modal-body .form-group input[type="email"]:focus,
[data-theme="light"] .modal-body .form-group textarea:focus {
    background: rgba(255, 255, 255, 1) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15) !important;
}

[data-theme="light"] .modal-body .form-group input[type="text"]::placeholder,
[data-theme="light"] .modal-body .form-group input[type="email"]::placeholder,
[data-theme="light"] .modal-body .form-group textarea::placeholder {
    color: #9ca3af !important;
}

[data-theme="light"] .modal-body .form-group small.text-muted {
    color: #6b7280 !important;
}

[data-theme="light"] .modal-body .form-group .form-check-label {
    color: #1f2937 !important;
}

