/* modal.css — 通用彈窗 (#customModal) 與 toast，深色主題 */
#customModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9997;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#customModal.active {
    display: flex;
}

.modal-dialog {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-3);
    min-width: 300px;
    max-width: 92vw;
    padding: 28px 24px 22px;
    text-align: center;
    animation: modalIn 0.18s cubic-bezier(.4, 1.6, .6, 1) both;
}

@keyframes modalIn {
    0% { transform: scale(0.94); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#customModal .modal-title {
    font-size: var(--fs-lg);
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-color);
    justify-content: center;
    width: 100%;
}

.modal-message {
    font-size: var(--fs-md);
    color: var(--text-secondary-color);
    margin-bottom: 22px;
    word-break: break-word;
    line-height: 1.6;
}

.modal-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    padding: 0 24px;
    height: 40px;
    font-size: var(--fs-md);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color var(--ease);
}

.modal-btn.ok {
    background: var(--primary-color);
    color: #fff;
}

.modal-btn.ok:hover {
    background: var(--primary-hover);
}

.modal-btn.cancel {
    background: var(--surface-2);
    border-color: var(--border-color);
    color: var(--text-color);
}

.modal-btn.cancel:hover {
    background: var(--surface-3);
}

#customModal.modal-success .modal-title {
    color: var(--success-hover);
}

#customModal.modal-error .modal-title {
    color: var(--danger-hover);
}

#customModal.modal-warning .modal-title {
    color: var(--warning-hover);
}

/* toast */
.custom-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    z-index: 9998;
    min-width: 180px;
    max-width: 90vw;
    background: var(--surface-3);
    color: var(--text-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-2);
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--primary-color);
    padding: 13px 22px;
    font-size: var(--fs-md);
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-24px);
    transition: opacity 0.3s, transform 0.3s;
}

.custom-toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    border-left-color: var(--success-color);
}

.toast-info {
    border-left-color: var(--info-color);
}

.toast-error {
    border-left-color: var(--danger-color);
}

.toast-warning {
    border-left-color: var(--warning-color);
}
