/* 通用弹窗样式 - 全局复用 */
.modal-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    font-family: inherit;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 2rem;
    width: min(600px, calc(100vw - 40px));
    max-width: calc(100vw - 40px);
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    margin: auto;
    z-index: 1;
}

.modal-content * {
    min-width: 0;
}

.modal-body {
    overflow-x: hidden;
}

.modal-body .form-group {
    width: 100%;
    max-width: 100%;
}

.modal-body label {
    display: block;
    max-width: 100%;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #333;
    padding-bottom: 1rem;
}

.modal-title {
    color: #ff8c00;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.5rem;
    line-height: 1;
}

.modal-close:hover {
    color: #ff8c00;
}

/* 弹窗按钮组 */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.modal-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    border: none;
    transition: background 0.2s ease;
}

.modal-btn-primary {
    background: #ff8c00;
    color: white;
}

.modal-btn-primary:hover {
    background: #e07b00;
}

.modal-btn-cancel {
    background: #333;
    color: #ccc;
}

.modal-btn-cancel:hover {
    background: #444;
}

/* 响应式适配 */
@media (max-width: 767px) {
    .modal-container {
        width: 100vw;
        max-width: 100vw;
        padding: 28px;
        align-items: center;
        justify-content: center;
    }

    .modal-content {
        position: fixed;
        left: 50%;
        right: auto;
        top: 50%;
        transform: translate(-50%, -50%);
        padding: 0.9rem;
        width: min(calc(100vw - 56px), 360px);
        max-width: min(calc(100vw - 56px), 360px);
        min-width: 0;
        max-height: min(78vh, calc(100vh - 48px));
        border-radius: 12px;
        margin: 0;
        overflow-y: auto;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .modal-body,
    .modal-body form,
    .modal-body .form-group,
    .modal-body input,
    .modal-body select,
    .modal-body textarea {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        font-size: 16px !important;
    }

    .modal-body .form-control {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-right: 0 !important;
        font-size: 16px !important;
    }

    .modal-body,
    .modal-body * {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .modal-header {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    .modal-title {
        font-size: 0.95rem;
        line-height: 1.35;
        padding-right: 0.5rem;
        white-space: normal;
        word-break: break-word;
    }

    .modal-close {
        flex: 0 0 auto;
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.8rem;
        margin-top: 1rem;
    }

    .modal-btn {
        width: 100%;
        padding: 0.65rem 0.75rem;
        font-size: 0.95rem;
        line-height: 1.3;
        white-space: normal;
        word-break: break-word;
    }
}
